home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
User's Choice Windows CD
/
User's Choice Windows CD (CMS Software)(1993).iso
/
win_m_p
/
pwez51.zip
/
WIND_REZ.DOC
< prev
Wrap
Text File
|
1992-04-01
|
246KB
|
6,469 lines
WINDOWS R-E-Z
VER. 5.10
CONNECT Software
6192 Fawn Meadow
Farmington, NY 14425
Richard Magnanti
(716) 924-3439
CPS: 71020,2040
GENIE: R.MAGNANTI
DELPHI: MAGNANTI
COPYRIGHT (c) 1988 - 1992 BY:
CONNECT Software
ALL RIGHTS RESERVED
CONTENTS
Differences in versions of WINDOWS R-E-Z ----------------- 1
Important notes for BASIC 7.0/7.1 ( PDS ) users.---------- 2
Important notes for UNENHANCED versions. ----------------- 3
General overview ( list of procedures included ) ------- 4-7
System and programming requirements ---------------------- 8
Windowing routines ------------------------------------ 9-17
The Active Window ------------------------------- 9
1.00 SETWIND -------------------------------------- 9-10
1.01 MAKEWIND ------------------------------------ 10-12
1.02 CHNGWIND --------------------------------------- 12
1.03 PRINTW ----------------------------------------- 12
1.04 SAVEWIND ------------------------------------ 12-13
1.05 RESAVE -------------------------------------- 13-14
1.06 RSTRWIND --------------------------------------- 14
1.07 DELWIND ---------------------------------------- 14
1.08 CLRWIND --------------------------------------14-15
1.09 NEWCOLOR --------------------------------------- 15
1.10 LINEW ------------------------------------------ 15
1.11 WAVAIL% ---------------------------------------- 16
1.12 WINDSTATUS ------------------------------------- 17
Pulldown windows ------------------------------------- 18-26
2.00 SETPULL ------------------------------------- 18-20
Example: SETPULL ---------------------------- 20-21
2.01 PULLDOWN ------------------------------------ 21-25
2.02 RSTRPULL ------------------------------------ 25-26
2.03 CHNGPULL --------------------------------------- 26
Scroll windows --------------------------------------- 27-46
3.00 SETSCRL ------------------------------------- 27-28
3.01 SCRLWIND ------------------------------------ 28-35
SCRLWIND example ( Auto-exit ) -------------- 35-36
3.02 B4SCRL -------------------------------------- 37-45
3.03 MARKED% ------------------------------------- 45-46
Get answer routine ----------------------------------- 47-48
4.00 GETANS -------------------------------------- 47-48
Input routines --------------------------------------- 49-64
5.00 INPTINIT ------------------------------------ 49-50
5.01 INPTWIND ------------------------------------ 50-53
5.02 RSTRINPT ------------------------------------ 53-54
Example: INPTWIND ------------------------------ 55
5.03 SETINPT ------------------------------------- 56-57
Example: SETINPT ---------------------------- 58-59
5.04 MULTINPT ------------------------------------ 59-63
Editing features for input routines ------------ 64
Directory routines ----------------------------------- 65-70
6.00 GETDISK ---------------------------------------- 65
6.01 FINDPATH --------------------------------------- 65
6.02 SETDISK ---------------------------------------- 65
6.03 DISKSIZE --------------------------------------- 66
6.04 FINDDIR ------------------------------------- 66-68
A directory scroll window ( example ) ------- 69-70
Keyboard and Mouse routines -------------------------- 71-72
7.00 KEYMOUSE% -------------------------------------- 71
KEYMOUSE% example ------------------------------ 71
7.01 MBUTTONS --------------------------------------- 72
7.02 MOUSEON ---------------------------------------- 72
Sound Routine ------------------------------------------- 72
9.00 DOSOUND ---------------------------------------- 72
Information line routines ---------------------------- 73-77
10.00 INFOLINE --------------------------------------- 73
10.01 PRINTINFO ----------------------------------- 73-74
10.02 INFOFIXED -------------------------------------- 74
10.03 RSTRINFO --------------------------------------- 74
Examples: Info-line routines ---------------- 75-77
Program format --------------------------------------- 78-81
Making a customized library ----------------------------- 82
Description of files --------------------------------- 83-85
Errors ----------------------------------------------- 86-90
Appendix --------------------------------------------- 91-94
Color attribute chart -------------------------------- 91
Multi-field code chart ------------------------------- 92
Border designation chart ----------------------------- 93
Keymouse code values --------------------------------- 94
Restrictions and disclaimer ----------------------------- 95
***************************
* NOTE ------ READ THIS! *
***************************
The information in this documentation refers to the
enhanced version of WINDOWS R-E-Z. Differences between the
QuickBasic ( 4.00, 4.00b and 4.50 ) and the BASIC 7.+ (PDS)
versions are detailed. The documentation can be used for the
unenhanced versions with the following exceptions.
1. MULTI-FIELD INPUT SCREENS - A maximum of 4 input
screens with a maximum of 25 fields per screen are available
in the unenhanced version. This compares to 10 multi-field
screens with up to 150 fields each, in the enhanced version.
2. MEMORY - The code in the unenhanced libraries is not
modular. Therefore executable programs made with the unen-
hanced libraries will contain all of the code even though
all of the procedures are not used. This will substantially
increase the length of any executable file and program.
With the enhanced versions of WINDOWS R-E-Z, it is not
necessary to link modules to executable programs if routines
in a module are not used by the program. Much smaller ex-
ecutable programs are consequently possible.
An additional library is included in the enhanced
versions which does not contain error checking or window
status capability. This library can be used after the
program is de-bugged and also represents an opportunity for
considerable memory reduction.
3. The BASIC 7.0/7.1 unenhanced version does not allow
the use of unnamed ( blank ) COMMON blocks. The enhanced
version has provisions for the use of same.
4. The section labeled "MAKING A CUSTOMIZED LIBRARY"
refers to the enhanced version of WINDOWS R-E-Z.
**********************************************************
** For information on obtaining the enhanced version **
** of WINDOWS R-E-Z see the file ORDER.ME. **
**********************************************************
1
Copyright(c) 1988-92 - By: CONNECT Software - All rights reserved.
Important notes for BASIC 7.0/7.1 ( PDS ) users.
ENHANCED AND UNENHANCED VERSIONS:
The /Ea option may be used when loading QBX. This allows
the use of expanded memory.
Window memory resides in a separate segment of string space
reserved for strings placed in unnamed ( blank ) COMMON
blocks. DO NOT USE BLANK COMMON BLOCKS IN YOUR PROGRAM.
EXAMPLE: COMMON SHARED A$ ' NOT PERMITTED
COMMON SHARED /BLOCKNAME/ A$ ' PERMITTED
Maximum window memory is 64k bytes. Calls to MAKEWIND or
SAVEWIND requesting window memory in excess of 64k bytes
will result in an "Out of string space" error message. As
64k represents sixteen full display windows (80 column mode)
this limitation should not be restrictive.
The use of far strings is required. This is the default for
programs compiled from the QBX environment. If the source
code is compiled on the command line the /Fs option must be
used with BC.
ENHANCED VERSION ONLY:
An additional object file PDSMEM70/71.OBJ is included which
allows the use of unnamed (blank) COMMON blocks. It must re-
place the object file PDSMEM.OBJ which is included in the
libraries. Window memory will share main module string
space after this change is made. To make this change;
1. Make new library files. ( Save old library files! )
LIB PDSALL70.LIB-PDSMEM.OBJ+PDSMEM70.OBJ; ( BASIC 7.0 )
LIB PDSNER70.LIB-PDSMEM.OBJ+PDSMEM70.OBJ; ( BASIC 7.0 )
LIB PDSALL71.LIB-PDSMEM.OBJ+PDSMEM71.OBJ; ( BASIC 7.1 )
LIB PDSNER71.LIB-PDSMEM.OBJ+PDSMEM71.OBJ; ( BASIC 7.1 )
2. Make new quick-libraries. ( Save old quick-libraries! )
LINK/Q PDSALL70.LIB,PDSALL70.QLB,,QBXQLB.LIB; ( BASIC 7.0 )
LINK/Q PDSNER70.LIB,PDSNER70.QLB,,QBXQLB.LIB; ( BASIC 7.0 )
LINK/Q PDSALL71.LIB,PDSALL71.QLB,,QBXQLB.LIB; ( BASIC 7.1 )
LINK/Q PDSNER71.LIB,PDSNER71.QLB,,QBXQLB.LIB; ( BASIC 7.1 )
2
Copyright(c) 1988-92 - By: CONNECT Software - All rights reserved.
Inportant notes -- Unenhanced versions of WINDOWS R-E-Z.
QUICKBASIC 4.00/4.00b:
The library in the unenhanced, QuickBASIC 4.++, version of
WINDOWS R-E-Z was made using QuickBASIC 4.50. This may cause
keyboard problems ( BACKSPACE, "G" ) with users of QuickBASIC
4.00 and 4.00b in the QB editor. This can be solved by making
a new quick library ( QB4UNEN.QLB ).
For QB 4.00 make a new library using link:
LINK/Q QB4UNEN.LIB, QB4UNEN.QLB,,BQLB40.LIB;
For QB 4.00b make a new library using link:
LINK/Q QB4UNEN.LIB, QB4UNEN.QLB,,BQLB41.LIB;
A message stating the following will be issued.
LINK WARNING L4051: BRUN45.LIB: CANNOT FIND LIBRARY
Enter new file spec:
Press ENTER. The file, BRUN45.LIB, is not required.
Another massage stating the following will be issued.
LINK: error L2029: Unresolved externals:
FIDRQQ in file(s): ( Ignore this message )
( several files will be listed )
The ENHANCED version of WINDOWS R-E-Z provides libraries for
the user specified version of QuickBASIC.
BASIC 7.0:
The library in the unenhanced, BASIC 7.0/7.1, version of
WINDOWS R-E-Z was made using BASIC 7.1. If you are using
BASIC 7.0 the following message will appear when making
executable programs from within the QBX environment.
LINK WARNING L4051: BRT71EFR.LIB: CANNOT FIND LIBRARY
Enter new file spec:
Press ENTER. The file, BRT71EFR.LIB, is not required.
The ENHANCED version of WINDOWS R-E-Z supplies libraries for
the user specified version of BASIC ( version 7.0 or 7.1 ).
3
Copyright(c) 1988-92 - By: CONNECT Software - All rights reserved.
*** GENERAL OVERVIEW ***
WINDOWS R-E-Z is a collection of QuickBASIC and assembly
routines which provide users of QuickBASIC ver. 4.00+ and
BASIC 7.0+ ( PDS ) with a complete window management system.
With WINDOWS R-E-Z users can make, save, restore, and delete
up to twenty windows. The memory used to save windowed
areas is dynamically allocated and outside of basic's normal
data storage area leaving more room for the basic programs
data. Windows are assigned a number from zero to twenty.
"INPUT WINDOWS" and "MULTI-FIELD INPUT" routines are
also provided. "INPUT WINDOWS" provide a convenient means
to prompt for, and receive an input. "MULTI-FIELD INPUT"
allows users to define up to 10 input screens, each having up
to 150 input fields. Numerous options are included for
input fields.
WINDOWS R-E-Z provides users the ability to incorporate
"PULLDOWN WINDOWS", emulating those used in the QuickBASIC
programming environment, in their programs.
Directory routines find the default drive and path, disk
size and free space, and directory listing for any path.
File size, date, time, and attributes can also be found.
Information line routines provide an easy means to print
messages, directions, or prompts, anyplace on the display.
Several other routines are included which allow the use
of "GET ANSWER WINDOWS" and "SCROLL WINDOWS". The ability
to read KEYBOARD and MOUSE input is also provided with
WINDOWS R-E-Z.
All of the routines require a minimal amount of initial-
ization and the resulting programs present a professional
appearance.
Unlike many other basic "add-ons", WINDOWS R-E-Z
provides extensive error detection and reporting.
Procedures included:
SETWIND -------- Set up routine for windowing procedures.
MAKEWIND ------- Makes a window. Saves windowed area to
window memory. The window becomes the
"active window".
SAVEWIND ------- Saves a screen area to window memory.
RESAVE --------- Saves the active window.
4
Copyright(c) 1988-92 - By: CONNECT Software - All rights reserved.
RSTRWIND ------- Restores a window area to the display.
DELWIND -------- Deletes a window area from window memory.
CHNGWIND ------- Changes the active window to another
window.
NEWCOLOR ------- Changes the print-to color of the active
window for text printed by PRINTW.
The print-to color is used by CLRWIND to
clear the active window's interior.
CLRWIND -------- Clears the interior of the active window.
PRINTW --------- Prints text in the active window using
the window's "print-to" color.
LINEW ---------- Prints a line in the active window using
the window's "print-to" color.
WAVAIL% -------- (FUNCTION) Reports a window's availability.
WINDSTATUS ----- Reports window memory status.
SETSCRL -------- Changes default attributes for calls to
SCRLWIND.
B4SCRL --------- Sets exit keys and "marked entry string"
for a subsequent call to SCRLWIND.
SCRLWIND ------- Places a scrollable list in the active
window.
MARKED% -------- (FUNCTION) Returns position of marked
items after a call to SCRLWIND.
SETPULL -------- Set up routine for pulldown windows.
PULLDOWN ------- Makes pulldown windows. On exit the
displayed pulldown window is the active
pulldown window.
RSTRPULL ------- Restores the area under the active
pulldown window and menubar. Deactivates
the active pulldown window.
CHNGPULL ------- Changes the color of, and disables or
enables an item in a pulldown window.
INPTINIT ------- Initializes input memory. Sets date format,
decimal designator, and "exit keys".
5
Copyright(c) 1988-92 - By: CONNECT Software - All rights reserved.
INPTWIND ------- Makes an input field with an optional
window. The field can be edited by
the user. On exit the displayed input
line or window is the active input window.
RSTRINPT ------- Restores the area under the active input
window to the display. Deactivates the
active input window.
SETINPT -------- Set up routine for multi-field input
screens.
MULTINPT ------- Places input fields on the screen as
defined by a previous call to SETINPT.
INFOLINE ------- Sets coordinates and color for the info-line.
Also turns on the info-line. Saves the area
of the display reserved by the info-line. The
info-line displays a prompt or message.
PRINTINFO ------ Prints a prompt or message in the info-line.
INFOFIXED ------ Defines a fixed string for the info-line. The
string is printed every time PRINTINFO is
called. The string specified in PRINTINFO is
added to the string defined in this routine.
Useful for scroll and pulldown windows.
RSTRINFO ------- Restores the display area under, and option-
ally turns off the info-line.
GETANS --------- Makes a get answer window or single line
prompt. Waits for a single key response.
DOSOUND -------- Produces sound determined by SETWIND.
GETDISK -------- Returns the default disk drive.
SETDISK -------- Sets the default disk drive.
FINDPATH ------- Returns the default path for any drive
( current directory ).
DISKSIZE ------- Returns disk size and free space.
FINDDIR -------- Returns the directory of any drive or path
in a string array.
KEYMOUSE% ------ (FUNCTION) Waits for keyboard or mouse
input, or mouse movement. Returns a code
for the key pressed or mouse movement.
6
Copyright(c) 1988-92 - By: CONNECT Software - All rights reserved.
MBUTTONS ------- Redefines the mouse buttons.
MOUSEON -------- Turns the mouse on, off, or disables
movement detection.
7
Copyright(c) 1988-92 - By: CONNECT Software - All rights reserved.
--------------------------------------------------------
*** SYSTEM AND PROGRAMMING REQUIREMENTS ***
COMPUTER:
IBM PC (XT or AT) or compatible computer. One disk drive.
VIDEO ADAPTOR CARD:
MONO, CGA, EGA or VGA emulating CGA.
PROGRAMMING LANGUAGE:
For the QB4.+ version;
QuickBASIC version 4.00 or greater.
- Text mode
For the BASIC 7.+ (PDS) version;
BASIC 7.0 or greater.
- Text mode
- Requires use of "far strings". This is the default
if executable programs are produced from within
QBX. If modules are compiled using BC on the command
line ( outside of the QBX environment ) the /Fs option
must be used.
DOS: Version 2.1 or higher.
-------------------------------------------------------
8
Copyright(c) 1988-92 - By: CONNECT Software - All rights reserved.
USING WINDOWS R-E-Z
THE ACTIVE WINDOW
When a window is defined ( made ) the number assigned to it
by the programmer represents the area covered by the window.
The area is restored or deleted via it's "number". Up to 20
window areas can be saved. The memory used to save the
window areas is automatically managed by WINDOWS R-E-Z.
Any time a window is made it becomes the "active" window. The
active window is used by the following routines.
PRINTW --- Prints text in the active window.
LINEW ---- Prints a line in the active window.
SCRLWIND - Places a scrollable list in the active
window.
CLRWIND -- Clears all text from the interior of the
active window.
RESAVE -- Saves the active window and any text in the
active window.
NEWCOLOR - Changes the "print-to" color of the active
window.
NOTE: ACTIVE INPUT AND PULLDOWN WINDOWS MAY ALSO EXIST. THESE
WINDOWS ARE NOT RELATED TO THE ACTIVE WINDOW GENERATED BY THE
WINDOWING ROUTINES.
1.00 SETWIND ( FST%, SND%, SHAD% )
Description: SETWIND must be called at least once in
any program using the routines in WINDOWS-R-E-Z, prior
to calling the routines. This procedure initializes
window memory. It also sets the default windowing
speed, sound, and window shadow color.
The first call to SETWIND initializes window memory and
sets the default parameters. Subsequent calls to
SETWIND will not affect window memory but can be used
to change the default parameters.
NOTE: IF A CLEAR STATEMENT IS EXECUTED BY THE PROGRAM
ALL WINDOW MEMORY IS LOST. ANY WINDOW AREAS SAVED IN
WINDOW MEMORY ARE LOST. SETWIND MUST BE CALLED AGAIN
TO RE-INITIALIZE WINDOW MEMORY AFTER EXECUTING A CLEAR
STATEMENT.
Arguments: FST% is used to allow "fast" windowing
if a CGA video card, or emulation, is detected. If
FST% = 0 window routines will be slower on computers
with CGA. If FST% = 1 the window routines will be
9
Copyright(c) 1988-92 - By: CONNECT Software - All rights reserved.
"fast" on computers with CGA. This may, however, cause
"snow" with certain CGA cards. If a monochrome card is
detected, FST% is ignored. All windowing is "fast".
SND% determines which sound will be
generated by the routines. If SND% = 1 a "CLICK" sound
will be generated. If SND% = 2 a "BEEP" sound will be
produced. Any other value produces no sound.
SHAD% sets the color for window shad-
ows. See the color attribute chart for details. Set-
ting SHAD% to 7 works well for monochrome displays while
setting SHAD% to 8 works well for color displays.
1.01 MAKEWIND (W%, LABEL$, TR%, LC%, WIDE%, NR%, ATTR%, BORBER%)
Description: Makes a window. May also save a window-
ed area to window memory. The window becomes the active
window. Calls to PRINTW, LINEW, SCRLWIND, CLRWIND,
RESAVE, and NEWCOLOR refer to the active window.
Arguments: W% is the window number and must equal 0 to
20. If W% = 0 the area under the window is not saved.
A window is simply made. If W% is from 1 to 20 the area
under the window is saved and may be restored at a later
time via a call to RSTRWIND. If W% is the number of a
window area previously saved by MAKEWIND or SAVEWIND an
error is reported.
NOTE: WHEN WINDOW NUMBER 1 TO 20 IS MADE AN IMAGE OF THE
DISPLAY AREA UNDER THE WINDOW IS SAVED IN WINDOW MEMORY.
THIS AREA MAY BE RESTORED TO THE DISPLAY BY CALLING
ROUTINE RSTRWIND. ROUTINE RSTRWIND MAY OPTIONALLY REMOVE
THE "SAVED" DISPLAY AREA FROM WINDOW MEMORY.
A SECOND ROUTINE, DELWIND, MAY BE USED TO REMOVE
THE "SAVED" DISPLAY AREA FROM WINDOW MEMORY. THIS
ROUTINE DOES NOT, HOWEVER, RESTORE THE "SAVED" DISPLAY
AREA TO THE SCREEN. DO NOT CONFUSE THESE ROUTINES!!
SEE THE DESCRIPTIONS FOR ROUTINES RSTRWIND AND DELWIND
FOR DETAILS.
LABEL$ is the text printed on the top
border or in the title box (see BORDER%) of the window.
By default the print starts on the second column. If
the left character of LABEL$ ="@" the text will be
centered. If LABEL$ is too long it will be truncated to
fit on the top border or in the title box.
TR% is the top row of the window. If TR% =
100 the window will be centered from top to bottom. TR%
can range from 1 to 23 or may equal 100. Any other
value for TR% will result in a error.
10
Copyright(c) 1988-92 - By: CONNECT Software - All rights reserved.
LC% is the left column position of the win-
dow. If LC% = 100 the window will be centered from left
to right. LC% can range from 1 to 78 if the display
width is 80 or from 1 to 38 if the display width is 40.
WIDE% is the window's width. WIDE% must be
greater than 2. WIDE% + LC% -1 must not be greater than
the displays width ( 40 or 80 ).
NR% is the number of rows in the window and
must be greater than 2. NR% + TR% must not be greater
than 26. If NR% is less than 5 a window title box is
not permitted.
ATTR% is the window's color and may be in
the range of 0 to 255. The foreground ( window's label
and border ) color equals ATTR% MOD 16. The background
color equals INT( ATTR% / 16 ). If the background color
is greater than 7 the foreground flashes and the back-
ground color equals background color - 8. If the fore-
ground and background colors are the same the border and
label will not be visible. ( SEE THE COLOR ATTRIBUTE
CHART.) ATTR% becomes the print-to color for window W%.
BORDER% sets the window's border and shadow
and can be up to 3 digits in length.
DIGIT = #3 #2 #1
Example = 1 1 1 ( 111 )
Digit #1 sets the border.
0 = No border
1 = Single line border
2 = Double line border
Digit #2 sets the shadow.
0 = No shadow
1 = Right/Bottom shadow
2 = Left/Bottom shadow
3 = Left/Top shadow
4 = Right/top Shadow
Digit #3 set the title box.
0 = No title box
1 = title box
The example (111) has a 1 for each digit. The window
will have a single lined border, a shadow on the right
and bottom and a title box
11
Copyright(c) 1988-92 - By: CONNECT Software - All rights reserved.
NOTE: IF BORDER% IS 100 OR GREATER AND THE NUMBER OF
ROWS (NR%) IS LESS THAN 5 TITLE BOXES ARE NOT PERMITTED.
SEE THE BORDER DESIGNATION CHART IN THE APPENDIX FOR
FURTHER DETAILS.
1.02 CHNGWIND (W%)
Description: Makes window, W%, the active window.
W% must represent a window area in window memory.
Argument: W% is the window number. It must range from
0 to 20. If W% does not represent a window saved by a
previous call to MAKEWIND, CHNGWIND reports an error.
NOTE: W% CAN NOT REPRESENT A WINDOW SAVED BY "SAVEWIND".
IT MUST REPRESENT A WINDOW SAVED BY "MAKEWIND".
1.03 PRINTW (TEXT$, R%, LC%)
Description: Prints text to the active window. Care
must be used to assure the active window is visible
as PRINTW will print predicated on the coordinates of
the active window regardless of it's visibility. It is
advisable, therefore, to print to a window immediately
after it is made the active window. The text's color
will be the print-to color of the active window. If
no window is active when PRINTW is called an error will
be reported.
Arguments: TEXT$ is the text to be printed.
R% is the row in the window were the text
will print . If R%=1 the text will print in the first
row below the border or title box. PRINTW may be used to
print a label in the bottom border of the window by
setting R% to the number or rows in the active window
minus 1 ( minus 3 if a title box was specified ). An
invalid value for R% will result in a reported error.
LC% is the left column where TEXT$ starts
printing. If LC%=100 the text will be centered left to
right. IF LC% plus the length of TEXT$ is greater than
the windows width minus 2 an error will be reported.
1.04 SAVEWIND (W%, TR%, LC%, WIDE%, NR%)
Description: Saves a portion of the screen in window
memory. This procedure is the same as MAKEWIND except
no window is made. The area designated by the arguments
12
Copyright(c) 1988-92 - By: CONNECT Software - All rights reserved.
is saved. If the number assigned to W% represents a
window area previously saved by MAKEWIND or SAVEWIND an
error is reported. An area saved via SAVEWIND can be
"popped" to the screen at appropriate times during
program execution by RSTRWIND ( see description ). A
screen area saved by SAVEWIND DOES NOT BECOME THE
ACTIVE WINDOW. SAVEWIND differs from RESAVE in that it
saves an area of the screen specified by it's
arguments. RESAVE saves the area of the screen as
designated by the coordinates of the active window.
Arguments: W% must range from 1 to 20.
See MAKEWIND for a description of the
remaining arguments.
1.05 RESAVE
Description: Saves the active window, it's interior,
and shadow. As window number 0 can not be saved the
active window can not be window number 0. If there is
no active window or window number 0 is active when
RESAVE is called an error will be reported.
The screen area saved under the active window is removed
from window memory and replaced with the active window
and it's interior. After complex screens are made in
the active window's interior, RESAVE can be used to save
them. They can be restored to the screen using
RSTRWIND. Use RESAVE immediately after a window is made
and it's interior is filled as RESAVE will save the
area of the screen determined by the active window's
coordinates, even if it is not visible.
Use RESAVE as follows;
1. Make a window number 1 to 20 via a call to MAKEWIND.
This becomes the active window.
2. Print in the window using PRINTW. Additional windows
may also be printed in the window. Use window number
0 to make the additional windows, as the screen area
under them need not be saved.
3. Call CHNGWIND to make the window number used in step
1 the active window. ( Only required if additional
windows were made inside the original window. )
13
Copyright(c) 1988-92 - By: CONNECT Software - All rights reserved.
4. Call RESAVE to save active window.
5. Use RSTRWIND to "pop" the window and it's interior on
the screen any time during program execution.
6. After the window is restored to the screen it may be
printed in again provided it is the active window.
This may require a call to CHNGWIND.
Arguments: None.
1.06 RSTRWIND (W%, DELFLAG%)
Description: Restores a window area previously saved
by MAKEWIND, SAVEWIND or RESAVE. The window area (W%)
must exist in window memory or RSTRWIND does nothing.
Arguments: W% is the number ( 1 to 20 ) assigned to
the saved window area to be restored to the screen. The
window area is returned to it's original coordinates.
DELFLAG% is set to zero to keep the
windowed area in window memory. If the DELFLAG% is not
zero the saved window area (W%) is deleted from window
memory. If W% was the active window an active window
will no longer exist.
1.07 DELWIND (W%)
Description: Deletes a saved window area (W%) from
window memory, if it exists in window memory. If the
window is the active window an active window will no
longer exist.
NOTE: DELWIND DOES NOT RESTORE THE "SAVED" WINDOW AREA
TO THE DISPLAY. IT ONLY REMOVES THE "SAVED" WINDOW AREA
FROM WINDOW MEMORY. ROUTINE RSTRWIND MUST BE USED TO
RESTORE THE "SAVED" WINDOW AREA TO THE DISPLAY.
Argument: W% is the window area number.
1.08 CLRWIND
Description: Clears the interior of the active window.
Care must be taken to assure that active window is
visible as CLRWIND clears the area of the screen
designated as the interior of the active window regard-
less of the window's visibility. The window will be
cleared with it's print-to color. If no window is
14
Copyright(c) 1988-92 - By: CONNECT Software - All rights reserved.
active when CLRWIND is called, an error is reported.
Arguments: None
1.09 NEWCOLOR ( ATTR% )
Description: Changes the print-to color of the active
window. Text printed in the window by PRINTW or lines
printed in the window by LINEW will assume the new color
specified by this routine. If the active window is
cleared via a call to CLRWIND, it's interior will be
cleared with the color specified by NEWCOLOR. The color
designation will be retained and used by subsequent
calls to PRINTW or LINEW for the window which was active
when NEWCOLOR was called. If no window is active when
NEWCOLOR is called, an error is reported.
Argument: ATTR% is the new color attribute. SEE
THE COLOR ATTRIBUTE CHART.
1.10 LINEW ( ROW%, TYP% )
Description: Prints, or erases a line in the active
window. If an active window does not exist an error is
reported. The line will assume the print-to color of the
active window. As the border characters are changed
when a line is printed, the color of the border
characters may change also. This will occur if the
print-to color is not the same as the color of the
border characters in the active window.
Arguments: ROW% is the row, of the interior, of the
active window where a line will print. If ROW% < 1 or
ROW% greater then the number of rows in the interior of
the active window an error will be reported.
TYP% is the type of line which will print
and may be as follows;
TYP% Line type
1 Single line
2 Double line
0 Erases a line and returns
normal border characters.
Other values Defaults to single line.
NOTE: IF TYP% = 0 ANY TEXT ON THE LINE IN THE WINDOW,
POSITIONED IN ROW, ROW% WILL BE ERASED.
15
Copyright(c) 1988-92 - By: CONNECT Software - All rights reserved.
1.11 WAVAIL% ( WINDNUM% )
Description: WAVAIL% is a function. It determines if a
window is available. A window is available if it has
never been used or if it has been used and subsequently
deleted by routines RSTRWIND or DELWIND. AS WAVAIL% IS A
FUNCTION IT IS IMPERATIVE IT IS DECLARED IN ANY MODULE
USING IT. WAVAIL% equals 1 if a window is available.
WAVAIL% equals 0 if a window is not available.
Argument: WINDNUM% is the window number. It may range
from 1 to 25. Windows 1 to 20 are used in the window
management system. Window 22 is used for the get answer
window in routine GETANS. The following applies to
windows 21, 23, 24, AND 25.
WINDOW# WAVAIL% MEANING
=
21 0 There is an active input window. It
may be deleted by routine RSTRINPT. A
call to INPTWIND re-enters the active
input window.
21 1 There is no active input window.
Calling INPTWIND will make a new active
input window.
23 0 There is an active pulldown window. It
may be deleted by routine RSTRPULL. A
call to PULLDOWN re-enters the active
pulldown window.
23 1 There is no active input window.
Calling PULLDOWN will place the user at
the first selection of the pulldown
menubar.
24 0 There is an active pulldown menubar. It
may be deleted by routine RSTRPULL. A
call to pulldown will not save the
display area occupied by the menubar.
24 1 There is no active pulldown menubar.
Calling PULLDOWN will make an active
menubar and save the display area
occupied by same.
25 0 There is an active info-line. It may
be deleted by routine RSTRINFO. Calls
to PRINTINFO will print in the info-
line.
25 1 There is no active info-line. Calling
INFOLINE will make an active info-line.
16
Copyright(c) 1988-92 - By: CONNECT Software - All rights reserved.
1.12 WINDSTATUS
Description: This is a programming tool. Calling
WINDSTATUS reports window 0 to 20's. number, top row,
left column, width, number of rows, and attribute (color).
The attribute refers to the original attribute specified
by the call to MAKEWIND for each window. If the
attribute is "SAVED" the window area was saved by a call
to SAVEWIND, not MAKEWIND. WINDSTATUS also reports the
active window and total window memory used to save
window areas. Window number zero does not use window
memory as the area under it is not saved. To use
WINDSTATUS place a call to WINDSTATUS in the program at
the location where it is desirable to view each windows
parameters. The program will terminate and must be
restarted. First remove the call to WINDSTATUS.
Arguments: None.
17
Copyright(c) 1988-92 - By: CONNECT Software - All rights reserved.
***** PULLDOWN WINDOWS *****
These procedures generate a maximum of 10 pulldown windows
with a maximum of 22 selections ( lines ) in each window.
The area covered by the pulldown windows is saved and
restored as the window moves from one menubar item to the next.
Unlike the other windowing procedures pulldown windows will
only work in the 80 column display width mode. To select a
menubar item the ARROW keys can be used or the first letter
of the menubar item may be pressed. To select an item from
any of the pulldown windows the ARROW keys, or "KEY CHAR-
ACTER" for the item may be pressed. If the ARROW keys are
used the ENTER or RETURN key must be pressed to finalize the
selection. If a letter is pressed, and it is found, the
procedure is automatically exited without the need to press
the ENTER or RETURN keys. The ESC and FUNCTION keys may
optionally exit.
2.00 SETPULL ( TR%, LC% , WD%, PWIND$() )
Description: Must be called to set up the routine
PULLDOWN. Must be called prior to calling routines
PULLDOWN or CHNGPULL.
Arguments: TR% is the top row position of the menubar.
It must range from 1 to 21. If the top row position of
the menubar is set too low not allowing a pulldown window
to fit on the display an error will be reported ( WINDOW
WON'T FIT or SHADOW WON'T FIT ) when the pulldown window
is accessed.
LC% is the left column position of the
menubar. It must range from 1 to 73. If the left column
position of the menubar is set too high not allowing a
pulldown window to fit on the display an error will be
reported ( WINDOW WON'T FIT or SHADOW WON'T FIT ) when
the pulldown window is accessed.
WD% is the width of the menubar. WD% is
self adjusting if it is set outside of the permissible
range. The maximum width of the menubar is 81 - LC%.
The minimum width of the menubar equals the width of the
individuals items in the menubar plus two spaces between
each item plus two preceding spaces and one trailing
space. If WD% is set too low it self adjusts to the
minimum width. If it is set too high it self adjusts to
the maximum width. WD% only changes the length, by
adding trailing spaces to the menubar, if it is greater
then the minimum width and less then or equal to the
maximum width of the menubar.
18
Copyright(c) 1988-92 - By: CONNECT Software - All rights reserved.
PWIND$() is an array containing strings
representing menubar selections, the data for the info-
line for the menubar selections, and the individual
pulldown window selections. PWIND$() must be in the
correct format. The last selection in each pulldown
window must be followed by a "***" in PWIND$().
"ENDPULL" in PWIND$() marks the end of all pulldown
windows. PWIND$(1) must be the first string in the
array, NOT PWIND$(0). The following represents an
example of the required format for PWIND$() for a
pulldown window ( the first pulldown window ).
EXAMPLE:
PWIND$(1) = "File" ' Menubar selection for
( SEE BELOW ) ' pulldown window one.
PWIND$(2) = "File operations" ' This will print in
NOTE: MUST = "" IF INFO-LINE ' the info-line when
IS NOT USED. ' menubar selection 1
' is selected.
PWIND$(3) = "Save" ' Selections for the
PWIND$(4) = "Get" ' pulldown window.
PWIND$(5) = "Delete"
PWIND$(6) = "***" ' End of pulldown
' window.
PWIND(7) = ........ ' Start over for next
' pulldown window.
PWIND(?? - 1) = "***" ' End of last pulldown
' window.
PWIND(??) = "ENDPULL" ' End of all pulldown
data.
In the above example PWIND$(1) holds the menubar selection
for the first pulldown window. The menubar defaults to
two spaces between selections. If PWIND$(1) = "File " two
additions spaces will be inserted between "File" and the
next menubar selection. Only trailing spaces are
considered. Leading spaces are removed. PWIND$(2) holds
the data for the info-line ( SEE ROUTINE INFOLINE ) for
the first menubar selection, "File". For every menubar
selection in PWIND$() the following element of PWIND$()
MUST contain info-line data. If an info-line is not used
set the appropriate elements of PWIND$ to equal "".
Pulldown window selections follow the info-line data in
PWIND$(). Each element of PWIND$() which represents a
pulldown window selection has a "KEY CHARACTER". The key
19
Copyright(c) 1988-92 - By: CONNECT Software - All rights reserved.
character is the character which is searched for when a
key is pressed while in the PULLDOWN window environment.
The key character defaults to the first character in each
item. To designate the key character as a different
character follow the character with a "@". THIS IS ONLY
APPLICABLE TO THE PULLDOWN WINDOW SELECTIONS. THE
PULLDOWN MENUBAR SELECTIONS ALWAYS DEFAULT TO THE FIRST
CHARACTER. IF A "@" IS PLACED IN A MENUBAR STRING IT WILL
PRINT AS PART OF THE MENUBAR.
EXAMPLES:
PWIND$(3) = "Get File" ( Key character = "G")
PWIND$(4) = "Save F@ile" ( Key character = "F")
The "@" will not be displayed when the string is printed
in the pulldown window. The description for KEYATTR%
for the routine PULLDOWN describes how to make the key
character a different color, or high intensity, enabling
users to distinguish it as the key character.
NOTE: DO NOT PLACE THE "@" IN POSITION ONE OR TWO OF THE
STRING AS IT WILL PRINT IN THE PULLDOWN WINDOW. AS
STATED THE KEY CHARACTER WILL DEFAULT TO POSITION ONE IF
THE "@" IS OMITTED FROM THE STRING. THIS ELIMINATES THE
NEED TO PLACE THE "@" IN POSITION TWO.
If an element of PWIND$() = "-" and it is not the first
or last item in a pulldown window it will segment the
pulldown window by placing a line across the width of it.
If the "-" is the first or last item in the pulldown
window it will print as a "-".
EXAMPLE: PWIND$(4) = "-" Providing PWIND$(4) is not
last item in the pulldown window PWIND$(4) will
print as a line across the window.
--------------------------------------------------------
EXAMPLE: SETPULL
N%=30 ' USE THIS METHOD SO
DIM PWIND$(N%) ' PWIND$() IS DYNAMIC.
' DON'T USE DIM PWIND$(30).
TEMP%=0
WHILE PWIND$(TEMP%) <> "ENDPULL"
TEMP% = TEMP% + 1 ' TEMP% MUST START WITH 1.
READ PWIND$(TEMP%) ' READ PULLDOWN WINDOW DATA.
WEND
TR%=1: LC%=1: WD%=80 ' MENUBAR'S LOCATION/WIDTH.
CALL SETPULL ( TR%, LC%, WD%, PWIND$() ) 'SET PULLDOWN
ERASE PWIND$ ' COMPLETELY ERASES PWIND$()
' IF IT IS DYNAMIC.
20
Copyright(c) 1988-92 - By: CONNECT Software - All rights reserved.
DATA THIS :' MENUBAR SELECTION FOR PULL-
:' DOWN WINDOW #1.
DATA Sample window 1 :' INFO-LINE FOR MENUBAR
:' SELECTION FOR WINDOW 1.
DATA HELLO, JOE,*** :' WINDOW #1 SELECTIONS
DATA IS :' MENUBAR SELECTION - WINDOW 2.
DATA Sample window 2 :' INFO-LINE FOR MENUBAR SELECTION.
DATA HOW, ARE, -, YOU,*** :' WINDOW #2 SELECTIONS.
:' LINE PRINTED IN ROW 3
DATA A :' MENUBAR SELECTION - WINDOW 3.
DATA Sample window 3 :' INFO-LINE FOR MENUBAR SELECTION.
DATA I,AM@,FINE,*** :' WINDOW 3 SELECTIONS. "AM" HAS
:' A KEY CHARACTER OF "M".
DATA SAMPLE :' MENUBAR SELECTION - WINDOW 4.
DATA Sample window 4 :' INFO-LINE FOR MENUBAR SELECTION.
DATA BYE,*** :' WINDOW 4 SELECTION - ONE ITEM.
DATA ENDPULL :' END OF DATA ( CASE SENSITIVE )
--------------------------------------------------------
Array PWIND$() is dimensioned to hold the pulldown menubar,
info-line, and window data. This is only a temporary array
to hold the data and is erased after SETPULL is called.
The data is then read. The "***" signals the end of each
pulldown window and MUST be entered exactly as shown. The
"ENDPULL" signals the end for all pulldown windows and MUST
be the last data item read. If the format is not exactly
as shown an error will be reported or the windows will not
be as expected. In the example shown the first menubar
item is "THIS". It's associated pulldown window contains
the two items "HELLO" and "JOE". When "THIS" is selected
the info-line, if it is on, will display "Sample window 1".
The last menubar item is "SAMPLE" and it's pulldown window
contains one item "BYE". When "SAMPLE" is selected the
info-line will display "Sample window 3". The menubar is
located on line 1, column 1 ( TR%=1 and LC% = 1 ). It
occupies the entire row as WD% = 80.
NOTE: THE DATA MUST BE IN THE FORMAT SHOWN. THE CHAR-
ACTERS "***" MARK THE END OF EACH INDIVIDUAL WINDOW AND
THE WORD "ENDPULL" MARKS THE END OF ALL PULLDOWN WINDOWS.
2.01 PULLDOWN (INFO$(),BAR%,WIND%,EX$,RKEY%,ATTR%,KEYATTR%,BRDR%)
NOTE 1: ROUTINE "SETPULL" MUST BE CALLED ONCE PRIOR TO
CALLING THIS ROUTINE.
21
Copyright(c) 1988-92 - By: CONNECT Software - All rights reserved.
NOTE 2: ROUTINE "RSTRPULL" MUST BE CALLED AFTER THIS
ROUTINE IS EXITED TO DEACTIVATE THE ACTIVE PULLDOWN WINDOW
AND RESTORE THE DISPLAY AREAS UNDER THE ACTIVE PULLDOWN
WINDOW AND MENUBAR. IF "RSTRPULL" IS NOT CALLED THE
ACTIVE PULLDOWN WINDOW AND MENUBAR REMAIN ACTIVE.
( *** SEE RSTRPULL *** )
Description: Places the user in the pulldown window
environment. On entering PULLDOWN, the following occurs.
1. IF AN ACTIVE PULLDOWN WINDOW DOES NOT EXIST the scroll
bar will be positioned over first selection in the
pulldown menubar.
2. IF AN ACTIVE PULLDOWN WINDOW EXISTS the scroll bar will
be positioned over the active pulldown selection in the
active pulldown window ( SEE RSTRPULL ). This may be
appropriate if a selection from a pulldown window is
used to present the user with selections from another
scroll window external to PULLDOWN. If the user
presses ESC to exit the external scroll window PULLDOWN
may be re-entered exactly where it was exited. IN THIS
CASE THE ACTIVE PULLDOWN WINDOW MUST BE INTACT. IT
WILL NOT BE COMPLETELY RE-PRINTED. If the user makes a
selection from the external scroll window, the routine
RSTRPULL may be used to restore the area under the
pulldown window and deactivate the active pulldown
window. The next call to PULLDOWN displays the pulldown
menubar with the scroll bar positioned over the first
item.
IF AN ACTIVE PULLDOWN WINDOW UNKNOWINGLY EXISTS ON ENTRY
TO PULLDOWN THE ACTIVE PULLDOWN WINDOW, IF NOT DISPLAYED,
WILL HAVE IT'S INTERIOR PARTIALLY REPRINTED. THE WINDOW
WILL NOT BE RE-PRINTED.
Arguments: INFO$() is a string array holding the data
for the info-line ( SEE ROUTINE INFOLINE ) for each
pulldown windows's selections. Do not confuse this with
the info-line data which is associated with the menubar
selections as defined in routine SETPULL. The info-line
provides instructions or descriptions for the selections
in the pulldown windows. If pulldown window one holds
five selections, INFO$(1) holds the data for the first
selection in the window. INFO$(2) is the data for the
second selection. Corresponding elements of INFO$() and
the pulldown window's selections are related. A
SEGMENTING LINE IN A PULLDOWN WINDOW MUST BE REPRESENTED
BY A "" IN INFO$(). If pulldown window one contains
five selections and pulldown window two contains ten
selections, INFO$(6) will hold the data for the info-
line for the first selection in the pulldown window two
22
Copyright(c) 1988-92 - By: CONNECT Software - All rights reserved.
while INFO$(15) will hold the data for the info-line for
the last selection. The elements of INFO$() will only
be displayed in the info-line if it is "turned on" via
routine INFOLINE. IF AN INFO-LINE IS NOT USED INFO$()
MUST STILL BE A PREVIOUSLY DIMENSION ARRAY. DIMENSION
INFO$() TO ZERO BEFORE CALLING PULLDOWN.
EXAMPLE: DIM INFO$(0) 'IF INFO-LINE IS NOT USED
Using the example for the pulldown windows defined in
the call to SETPULL ( SEE - EXAMPLE: SETPULL ) the
following could apply to INFO$()
EXAMPLE: DIM INFO$(10) ' DO NOT ERASE THIS ARRAY!!!
INFO$() ' RELATED PULLDOWN SELECTION
----------------------------------------------------
INFO$(1) = "ONE" ' WINDOW 1 SELECTION "HELLO"
INFO$(2) = "TWO" ' WINDOW 1 SELECTION "JOE"
INFO$(3) = "THREE" ' WINDOW 2 SELECTION "HOW"
INFO$(4) = "FOUR" ' WINDOW 2 SELECTION "ARE"
INFO$(5) = "" ' WINDOW 2 -- LINE
INFO$(6) = "FIVE" ' WINDOW 2 SELECTION "YOU"
INFO$(7) = "SIX" ' WINDOW 3 SELECTION "I"
INFO$(8) = "SEVEN" ' WINDOW 3 SELECTION "AM"
INFO$(9) = "EIGHT" ' WINDOW 3 SELECTION "FINE"
INFO$(10) = "NINE" ' WINDOW 4 SELECTION "BYE"
The numbers ONE, TWO, THREE .... will print in the
info-line when the corresponding pulldown window
selection is covered by the scroll bar.
BAR% is the sequential number (left to right)
of selected menubar item . It is returned by the calling
procedure, PULLDOWN. If the second item in the menubar is
selected, BAR% will equal two. If ESC is pressed and
ESC is an exit key BAR% will equal 0 on exit. If a
function key is pressed and it is an exit key, BAR% will
equal the highlighted menubar selection on exit.
WIND% represents the row number of the
selected pulldown window item. It is returned by the
calling procedure. If the ESC pressed and ESC is an exit
key, WIND% will equal 0 on exit. If a function key is
pressed and it is an exit key, WIND% will equal the
highlighted pulldown window selection ( interior row
number ) on exit.
23
Copyright(c) 1988-92 - By: CONNECT Software - All rights reserved.
NOTE: A SEGMENTING LINE IN A PULLDOWN WINDOW OCCUPIES A
ROW POSITION.
EX$ sets the keys which will, when pressed,
exit PULLDOWN. The ENTER ( RETURN ) key always exits.
EX$ can be used to simulate a selection from a pulldown
window. ( SEE DESCRIPTION FOR ARGUMENT RKEY% ). EX$ may
be any combination of the following.
"0" The F10 key will exit.
"1" to "9" The F1 to F9 key will exit.
"E" The ESC key will exit.
EXAMPLE: EX$ = "E24" The ESC, F2, F4 and ENTER keys exit.
RKEY% returns a numeric representation for
the key which was pressed to cause the exit from PULLDOWN.
On exit RKEY% may equal the following.
1 to 10 The F1 to F10 key caused the exit.
13 The ENTER key caused the exit.
27 The ESC key caused the exit.
Arguments EX$ and RKEY% to may be used to simulate a
selection from a pulldown window. To use the F1 key to
simulate the first selection from the second pulldown
window, argument EX$ must contain a "1" on entering
PULLDOWN. Check to see if the F1 key caused the exit
( RKEY% = 1 ) from PULLDOWN. If it did set BAR% to 2
simulating the second pulldown window. Set WIND% to 1 to
simulate the first selection from the second pulldown
window.
NOTE: IF ROUTINE CHNGPULL IS USED TO DISABLE A PULLDOWN
WINDOW'S SELECTION AND THE SELECTION MAY ALSO BE SIMULATED
BY AN EXIT KEY, ARGUMENT EX$ MUST BE ADJUSTED ACCORDINGLY
TO PREVENT THE EXIT KEY FROM SIMULATING THE DISABLED
SELECTION.
ATTR% is the color. It follows the same
rules as described in MAKEWIND except a flashing
foreground is not permitted. Any value over 127 is
changed to ATTR% MOD 128.
KEYATTR% is the color of the key character
for selections in the pulldown windows. If KEYATTR% = 0
the key character will be the same color as the other
characters in each window selections. This would be
appropriate if the first character in each selection is
ALWAYS the key character. Setting KEYATTR% to a different
color, or high intensity, allows users to distinguish the
character as the key character for each item in the list.
24
Copyright(c) 1988-92 - By: CONNECT Software - All rights reserved.
Any value for KEYATTR% over 127 is changed to KEYATTR%
MOD 128.
BRDR% is the pulldown window's border
designation. BRDR% can equal 0, 1, 2, 10, 11 or 12 for
pulldown windows. Any other value for BRDR% will
result in an error. SEE THE BORDER DESIGNATION CHART.
2.02 RSTRPULL ( RSTRMENUBAR% )
Description: Restores the display area under and
deactivates the active pulldown window. The active
pulldown window is the displayed pulldown window when
routine PULLDOWN is exited. Normally a call to RSTRPULL
will be made when PULLDOWN is exited. There may be times,
however, when it is desirable to leave the active pulldown
window and menubar displayed. If this is the case
RSTRPULL should not be called after PULLDOWN is exited.
If RSTRPULL is NOT called after PULLDOWN is exited the
following will occur:
1. The pulldown window which was active when PULLDOWN
was exited will remain displayed.
2. The pulldown window which was active when PULLDOWN was
exited remains the active pulldown window. The next
call to PULLDOWN will return to the active pulldown
window with the previous ( active ) selection from the
pulldown window covered by the scroll bar.
NOTE: WHEN PULLDOWN IS RE-ENTERED UNDER THESE THE
ROUTINE, PULLDOWN, EXPECTS THE ACTIVE PULLDOWN WINDOW
AND MENUBAR TO BE INTACT. IF IT IS NOT, THE PULLDOWN
WINDOW WILL NOT BE DISPLAYED AS EXPECTED. IT IS
IMPORTANT THAT NO PORTION OF ACTIVE PULLDOWN WINDOW OR
MENUBAR IS "PRINTED OVER" PRIOR TO RE-ENTERING
PULLDOWN.
Argument: RSTRMENUBAR% determines if the area under the
menubar is restored to the display when RSTRPULL is
called. If RSTRMENUBAR% = 0 the menubar will remain
displayed after RSTRPULL is called and the menubar will
remain active. Subsequent calls to PULLDOWN DO NOT save
the area under the menubar. PULLDOWN expects the menubar
to be intact. If RSTRMENUBAR% = 1 the area under the
menubar is restored to the display and the menubar is
deactivated. Subsequent calls to PULLDOWN save the area
under, and display a new menubar. By virtue of a call to
RSTRPULL the area under the active pulldown window is
restored and the active pulldown window is deactivated.
25
Copyright(c) 1988-92 - By: CONNECT Software - All rights reserved.
The status of argument RSTRMENUMAR% has no affect on the
status of the active pulldown window. It only restores
and deactivates the menubar or allows same to remain
active. In either case the next call to PULLDOWN will
position the scroll bar over the first selection of the
menubar after a call to RSTRPULL.
NOTE: THE SAVED DISPLAY AREA FOR THE ACTIVE PULLDOWN
WINDOW RESIDES IN WINDOW NUMBER 23. FUNCTION WAVAIL% CAN
DETERMINE IF A PULLDOWN WINDOW IS ACTIVE.
EXAMPLE: IF WVAIL%(23) = 0 ' A pulldown window is active.
IF WVAIL%(23) = 1 ' A pulldown window is not
' active.
THE SAVED DISPLAY AREA FOR THEN MENUBAR RESIDES IN WINDOW
NUMBER 24. FUNCTION WVAIL% CAN DETERMINE IF THE MENUBAR
IS ACTIVE.
EXAMPLE: IF WAVAIL%(24) = 0 ' The menubar is active.
IF WAVAIL%(24) = 1 ' the menubar is not active.
2.03 CHNGPULL ( BARITEM%, WINDITEM%, ATTR% )
NOTE: ROUTINE SETPULL MUST BE CALLED ONCE IN EVERY PROGRAM
BEFORE ANY CALLS TO THIS ROUTINE.
Description: disables or enables the ability to select
the item, and changes the items color, in a pulldown window.
Arguments: BARITEM% is the sequential number ( left
to right ) of the menubar selection associated with the
item's pulldown window.
WINDITEM% is the row position of the item
in the pulldown window's interior.
NOTE: A LINE IN A PULLDOWN WINDOW OCCUPIES A ROW
POSITION.
ATTR% serves two purposes.
If ATTR% > 0 it changes the color of the item
specified by BARITEM% and WINDITEM% to ATTR% ( SEE THE
COLOR ATTRIBUTE CHART ). The key character in the item
also assumes the color specified by ATTR%. The ability
to select the item from the pulldown window is disabled.
Any value for ATTR% over 127 is changed to ATTR% MOD 128.
If ATTR% = 0 the color of the item, and it's key char-
acter is returned to it's original status as defined in
the original call to PULLDOWN. The ability to select
the item is enabled.
26
Copyright(c) 1988-92 - By: CONNECT Software - All rights reserved.
***** SCROLL WINDOWS *****
SCRLWIND places a scrollable list in the active window. A
highlight ( scroll ) bar is placed over a specified item in
the list and can be moved by the user via the UP and DOWN
ARROW keys or MOUSE. Pressing the ENTER key returns the
sequential item number covered by the scroll bar. The HOME,
END, PG UP, and PG DN keys move the scroll bar as indicated.
When a key is pressed SCRLWIND checks to see if the key matches
the KEY CHARACTER of any element of the list. If a match is
found the scroll bar moves to that position in the list.
3.00 SETSCRL ( ARROW%, NOHI%, TAGCOLOR% )
Description: Set up routine for routine SCRLWIND.
Determines if the position designator ( arrow ) on the
right border of the scroll window is displayed, how high
intensity characters are displayed, and the color of the
character representing marked ( tagged ) selections in a
"mark" scroll window.
NOTE1: IF SETSCRL IS NOT CALLED PRIOR TO CALLING SCRLWIND
THE DEFAULTS ARE;
1. THE POSITION DESIGNATOR ( ARROW ) IS NOT DISPLAYED.
2. HIGH INTENSITY CHARACTERS ARE DISPLAYED NORMALLY.
3. THE COLOR OF THE CHARACTER USE TO MARK ( TAG )
SELECTIONS IS THE SAME AS THE TEXT IN THE SCROLL
WINDOW.
NOTE2: SETSCRL NEED ONLY BE CALLED ONCE IN ANY PROGRAM.
ALL CALLS TO SCRLWIND AFTER CALLING SETSCRL RETAIN THE
ATTRIBUTES DESIGNATED BY THE ONE CALL TO SETSCRL. TO
CHANGE THE ATTRIBUTES SETSCRL MUST BE CALLED AGAIN.
Arguments: ARROW% determines if the position designator
( arrow ) on the right border of the scroll window is
displayed. If ARROW% equals 1 the arrow is displayed. If
ARROW% equals 0 the arrow is not displayed.
NOHI% determines how pulldown and scroll
window routines display high intensity "key" characters.
If NOHI% equals 0 and the key character's color is set to
a high intensity it is displayed as high intensity. If
NOHI% = 1 high intensity "key" characters are displayed in
reverse video. This is appropriate for LCD displays which
can not display high intensity characters. NOHI% affects
"key" characters only.
( SEE PULLDOWN AND SCRLWIND DESCRIPTIONS. )
27
Copyright(c) 1988-92 - By: CONNECT Software - All rights reserved.
TAGCOLOR% sets the color of the mark
designator for mark scroll windows. It affects the
foreground color only. TAGATTR% is therefore adjusted to
TAGATTR% and 15. If TAGATTR% is set to zero the color of
the mark designator defaults to the same color as the text
in the scroll window.
3.01 SCRLWIND (LIST$(), INFO$(), TL$, ENTRIES%, KIND$, RTRN%,
LI%, FC% RKEY%, KEYATTR%)
NOTE1: THE ABOVE MUST BE ON ONE LINE IN THE QB/QBX
ENVIRONMENT.
NOTE2: FOR ADVANCED FEATURES SEE ROUTINE B4SCRL. THESE
FEATURES INCLUDE THE ABILITY TO EXIT THIS ROUTINE USING
DEFINABLE "EXIT KEYS" AND THE ABILITY TO SET MARKED ( TAGGED )
SELECTIONS ON ENTRY.
NOTE3: SEVERAL GLOBAL DEFAULTS FOR THIS ROUTINE MAY BE
CHANGED BY ROUTINE SETSCRL.
Description: Places a list ( LIST$() ) in the active
window. The list is ENTRIES% long. There are two classes
of scroll windows.
1. Non-virtual scroll windows. If argument KEYATTR% does
not equal zero the scroll window is a non-virtual
scroll window. On entry, SCRLWIND, verifies each
element of LIST$() will fit in the scroll window with a
leading and trailing space added to the string. If any
item will not fit an error is reported. Non-virtual
scroll windows may be ( SEE ARGUMENT KIND$ ) regular,
auto-exit, multiple mark, single mark, or list scroll
windows.
2. Virtual scroll windows. If argument KEYATTR% equals
zero, the scroll window is a virtual scroll window.
Virtual scroll windows allow horizontal and vertical
scrolling. The LEFT ARROW and RIGHT ARROW key become
active. A differently colored "key character" is not
permitted in a virtual scroll window as the character
would not be visible when it is scrolled out if the
window. No checks are made to verify the string length
in a virtual scroll window. Virtual scroll windows may
be ( SEE ARGUMENT KIND$ ) regular, auto-exit, multiple
mark, single mark, or list scroll windows. If argument
KEYATTR% equals zero and all elements of the list will
fit in the window's width the scroll window assumes the
properties of a non-virtual scroll window. The RIGHT
ARROW and LEFT ARROW keys are not active.
28
Copyright(c) 1988-92 - By: CONNECT Software - All rights reserved.
NOTE: ARGUMENT KEYATTR% DETERMINES IF A SCROLL WINDOW IS
A VIRTUAL OR NON-VIRTUAL SCROLL WINDOW. SEE THE
DESCRIPTION FOR KEYATTR% FOR MORE INFORMATION.
Arguments: LIST$() is the array holding the strings to
be placed in the scroll window. Each element of the
array is a line in the scroll window. If the length of
any element is greater then the width of the window - 4
and the scroll window is a non-virtual scroll window
( KEYATTR% <> 0 ) an error is reported. LIST$(1) must be
the first string in the array, NOT LIST$(0).
Each selectable item in LIST$() has a "KEY CHARACTER".
The key character is the character which is searched for
when a key is pressed while in the SCRLWIND environment.
The key character defaults to the first character in
each item. To designate the key character as a
different character follow the character with a "@" in
the string.
EXAMPLE: LIST$(1) = "Get File" ( Key character = "G")
LIST$(2) = "Save F@ile"( Key character = "F")
The "@" will not be displayed when the string is printed
in the scroll window. The description for KEYATTR% for
this routine describes how to make the key character a
different color, or high intensity, enabling users to
distinguish it as the key character.
NOTE1: DO NOT PLACE THE "@" IN POSITION ONE OR TWO OF THE
STRING AS IT WILL PRINT IN THE SCROLL WINDOW. AS STATED
THE KEY CHARACTER WILL DEFAULT TO POSITION ONE IF THE
"@" IS OMITTED FROM THE STRING. THIS ELIMINATES THE
NEED TO PLACE THE "@" IN POSITION ONE OR TWO.
NOTE2: IF ROUTINE B4SCRL IS USED TO SET A SCROLL WINDOW'S
EXIT CRITERIA, AND ROUTINE B4SCRL'S ARGUMENT, EXIT$,
CONTAINS AN "X" THE "KEY CHARACTER" SEARCH FEATURE IS
DISABLED. DO NOT USE KEY CHARACTERS IF THIS IS THE CASE.
( SEE ROUTINE B4SCRL )
If an element of LIST$() = "-" and it is not the first
item in the list or the last item in the list and all of
the items in LIST$() will fit in the window's interior
the scroll window will be segmented. A line will print
across the window as determined by the position of the
"-" in LIST$(). If the previous conditions are not met
the string will print as a "-".
EXAMPLE: LIST$(2) = "-" ( Provided LIST$(2) is not
the last item in the list and the number of
29
Copyright(c) 1988-92 - By: CONNECT Software - All rights reserved.
interior rows in the window is greater than
two, LIST$(2) will print as a line.)
INFO$() is an array holding the individual
strings used for the information line for each entry in
the scroll window ( SEE ROUTINE INFO-LINE ). As the
scroll bar moves from entry to entry the message in the
info-line changes based on the element of INFO$() which
corresponds to the selected entry in the scroll window.
If the scroll bar is over the third entry in the scroll
window INFO$(3) will print in the info-line, provided the
info-line is on. A SEGMENTING LINE IN THE SCROLL WINDOW
MUST BE REPRESENTED BY AN ELEMENT IN INFO$(). IF A
SEGMENTING LINE OCCUPIES THE FOURTH ROW OF THE SCROLL
WINDOW INFO$(4) MUST EQUAL "". If the info-line is not
going to be used or if a fixed info-line message is to be
printed for all entries in the scroll window INFO$() must
still be a dimensioned array prior to calling SCRLWIND.
FOR NO INFO-LINE OR A FIXED INFO-LINE MESSAGE INFO$() MUST
BE DIMENSIONED TO ZERO ( EX: DIM INFO$(0) ).
TL$ is a string which will print in the title
box of a scroll window. TL$ is ignored if the scroll
window does not have a title box. TL$ is useful for
virtual scroll windows. When a virtual scroll window
scrolls up and down, TL$ does not move. When a virtual
scroll window scrolls left and right TL$ scrolls with the
window's interior. TL$ can, therefore, be longer than the
window's width when used with a virtual scroll window.
Although TL$ may be used in other ( non-virtual ) scroll
windows, the title for the scroll window can be generated
in the call to MAKEWIND for the scroll window.
ENTRIES% is the number of elements in the
array ( LIST$() ) to use in the scroll window.
KIND$ specifies the type of scroll window
and may be any of the following.
KIND$ DESCRIPTION ( Detail descriptions follow )
"A" Auto-exit scroll window.
"M" Multiple mark ( tag ) scroll window.
"S" Single mark ( tag ) scroll window.
"L" List scroll window. No scroll bar.
"V", "SV" View scroll window.
Any other value for KIND$ generates a regular scroll
window.
AUTO-EXIT SCROLL WINDOW ( KIND$ = "A" ) -- When in the
scroll window environment if a key pressed equals the key
30
Copyright(c) 1988-92 - By: CONNECT Software - All rights reserved.
character of an item in the scroll window the routine will
be exited. The scroll bar moves to the item found. The
position of the selected item in LIST$() will be returned
in RTRN%. If RTRN% = 2, LIST$(2) was selected. SCRLWIND
will exit with RKEY% equal to 13 simulating exit via the
ENTER (RETURN) key.
NOTE: IF ROUTINE B4SCRL IS USED TO SET A SCROLL WINDOW'S
EXIT CRITERIA AND ROUTINE B4SCRL'S ARGUMENT EXIT$ CONTAINS
AN "X" THE AUTO-EXIT FEATURE IS DISABLED. ( SEE ROUTINE
B4SCRL )
MULTIPLE MARK SCROLL WINDOW ( KIND$ = "M" ) -- Pressing
the <+> or INSERT key marks the item covered by the scroll
bar. A right arrow is printed to the left of the item in
the scroll window to signify it has been marked. The color
of this arrow may be changed by routine SETSCRL. Pressing
the <-> or DELETE key un-marks an item if it was marked.
Striking the PRINT ( not all systems ) key or SPACE BAR
marks all items, unless they were all previously marked,
in which case the PRINT ( not all systems ) key or SPACE
BAR will un-mark all items. Pressing the ENTER or RETURN
key returns a coded string in KIND$ which represents the
marked items. If KIND$ ="" no items were marked. If any
items were marked KIND$ will be ENTRIES% long. Each
character in KIND$ will correspond to an element in
LIST$(). If the first character of KIND$=" " LIST$(1) was
not marked. If the second character, in KIND$ = CHR$(16),
LIST$(2) was marked. Each un-marked element of LIST$()
will have a corresponding space (" ") in KIND$ while each
marked element will have a corresponding right arrow
( CHR$(16) ) in KIND$. See the description for the
function MARKED% for a method of decoding KIND$. The
multiple mark feature is disabled if a scroll window is
also defined as a list scroll window or a single mark
scroll window.
NOTE: THE USE OF ROUTINE B4SCRL AFFECTS MULTIPLE MARK
SCROLL WINDOWS AS FOLLOWS:
1. IF THE INSERT OR DELETE KEYS ARE SET AS EXIT KEYS BY
ROUTINE B4SCRL THE INSERT AND DELETE KEYS WILL NO
LONGER MARK AND UN-MARK ENTRIES. THE "+" AND "-" KEYS
WILL STILL MARK AND UN-MARK ENTRIES.
2. IF B4SCRL'S ARGUMENT EXIT$ CONTAINS AN "X" THE SPACE
BAR ( PRINT KEY ON SOME SYSTEMS ) DOES NOT MARK/UN-MARK
ALL ENTRIES.
SINGLE MARK SCROLL WINDOW ( KIND$ = "S" ) --- Provided
there is more than one item ( ENTRIES% > 1 ) in the scroll
31
Copyright(c) 1988-92 - By: CONNECT Software - All rights reserved.
window, one item will be marked as in the preceding
example for a "MULTIPLE MARK" scroll window. Only one
item can be marked, however. The marked item follows the
scroll bar. Pressing TAB, SHIFT TAB, ENTER, RETURN or ESC
will exit the scroll window with the selected item in
RTRN% and a representation of the "exit key" in RKEY%. If
the scroll bar is over LIST$(2), RTRN% = 2 was selected.
SINGLE MARK scroll windows with one entry ( ENTRIES%=1 )
do not have an item marked. These scroll windows can be
used as <OK>, <CANCEL>, <ABORT> etc... scroll windows.
VIEW ONLY SCROLL WINDOW ( KIND$ = "V" OR "SV" ) --- The
window will be filled with the strings in LIST$() and the
routine will be exited. IF KIND$ = "SV" the scroll window
is "VIEW ONLY -SINGLE MARK" scroll window. If ENTRIES% > 1
the item designated by the value of RTRN% will be marked.
( See description for RTRN%. )
LIST SCROLL WINDOW ( KIND$ = "L" ) --- This generates a
list scroll window. There is no scroll bar. This may be
useful for viewing virtual scroll windows. It may be used
for regular scroll windows also.
Any other value for KIND$ when entering SCRLWIND results
in a "REGULAR" scroll window. After the scroll bar is
moved to the selected item, pressing the ENTER or RETURN
key returns the selected item in RTRN%. Routine B4SCRL
provides alternate means to exit SCRLWIND.
RTRN% serves two purposes. One is to place
the scroll bar over the item specified by RTRN% when
entering SCRLWIND. If RTRN% < 1 or RTRN% > ENTRIES%,
RTRN% defaults to 1 and the scroll bar will be positioned
over the first item in the window.
EXAMPLE: RTRN% = 2 -- If there are a minimum of two
items in the scroll window ( ENTRIES% > 1 ) the scroll
bar will be over LIST$(2) when entering SCRLWIND.
RTRN% also returns the selected item when exiting
SCRLWIND. If RTRN% = 2, LIST$(2) was selected when
SCRLWIND was exited. If routine B4SCRL is used prior to
calling SCRLWIND it is possible to exit SCRLWIND on any
attempt to scroll before the first entry in the scroll
window or past the last entry in the scroll window. This
feature affects the value of RTRN% ( SEE ROUTINE B4SCRL).
NOTE: THE ITEM SELECTED IN LIST$(), AS INDICTED BY THE
VALUE OF RTRN%, MAY CONTAIN A "@" TO INDICATE THE KEY
CHARACTER. IF IT IS NECESSARY TO PRINT THE ITEM THE "@"
CAN BE REMOVED FROM IT USING THE FOLLOWING FUNCTION.
32
Copyright(c) 1988-92 - By: CONNECT Software - All rights reserved.
' FUNCTIONS MUST BE DECLARED. RTRN% = ITEM # SELECTED
' FROM LIST$().
DECLARE FUNCTION NO$( ITEM$ )
'( Place this at the start of the module.)
' IF RTRN% = 2 AND LIST$(RTRN%) = "Save F@ile", LIST$(2)
' CAN BE PRINTED AS "Save File" as follows.
PRINT NO$( LIST$(RTRN%) )
' INCLUDE THIS FUNCTION IN YOUR PROGRAM
FUNCTION NO$ ( ITEM$ )
A% = INSTR ( ITEM$, "@" )
IF A% < 3 THEN ' "@" SHOULD NOT BE IN POSITION
NO$ = ITEM$ ' 1 OR 2, OR NO "@" IS IN ITEM$.
ELSE
NO$ = LEFT$(ITEM$, A% - 1) + MID$(ITEM$, A% + 1)
END IF
END FUNCTION
LI%, on entry to routine SCRLWIND, specifies
which row ( of the interior of the scroll window ) to
place the scroll bar on. It is used, on entry, with
argument RTRN% to place the scroll bar over a specific
entry on a specific row. This is useful if it is
necessary to exit a scroll window and re-enter it with the
scroll bar over the same entry and on the same line as on
the previous exit. Set this argument to one if it is not
required . The following restrictions apply.
1. If LI% is less than one or LI% is greater than the
number of entries ( ENTRIES% ) LI% is indeterminate.
The scroll bar will be positioned over the entry
specified by argument RTRN%.
2. Argument RTRN% determines the line the scroll bar will
occupy ( argument LI% is ignored ) if an attempt is
made to place an entry on a line greater than the
subscript of the entry. For example, LIST$(2) can not
be placed on line 3 of the scroll window. This would
cause line one to be blank. If RTRN% = 2 on entry, LI%
defaults to 2 also, if LI% is set to a number higher
than 2.
3. If all of the entries fit in the scroll window argument
LI% is ignored on entry. The scroll bar will occupy
the line based on the value of RTRN%. If RTRN% = 3 the
scroll bar will be positioned on line 3 regardless of
the value of LI%
33
Copyright(c) 1988-92 - By: CONNECT Software - All rights reserved.
4. If there are more entries than interior rows in the
scroll window, the last "interior rows" of entries fill
in from the bottom of the scroll window. For example,
assuming a scroll window has 10 interior rows and 20
entries, the 20th entry can be positioned no higher
than the 10th interior row, the 19th entry can be
positioned no higher than the ninth interior row, and
so on. If one of the last "interior rows" of entries
is specified by argument RTRN% on entry, and LI%
attempts to place the entry on row higher than outlined
above, LI% is adjusted appropriately.
On exit from routine SCRLWIND, LI% equals the interior row
number of the scroll window that the scroll bar occupied
prior to the exit.
FC% is used with virtual scroll windows to
position a specified string position for the entries in
the scroll window on the first useable column (2) of the
scroll window. On entry to SCRLWIND, FC% sets the string
position for the first column of the scroll window. On
exit FC% points to the string position occupying column
two. FC% IS ONLY APPLICABLE TO VIRTUAL SCROLL WINDOWS.
FC% has one purpose. It allows re-entry into a virtual
scroll window exactly as it was displayed on exit if used
with arguments RTRN% and LI% on re-entry. Set this
argument to one if it is not required.
EXAMPLE: On entry FC% = 5 and LIST$(1) ="12345678901234".
"5678901234" will be displayed in a virtual
scroll window. The first displayed character
in LIST$(1) will be "5".
RKEY% represents the key or action used to
exit SCRLWIND.
RKEY% may equal any of the following.
RKEY% EXIT KEY KIND$
** 1 to 10 F1 to F10 ALL
13 ENTER ( RETURN ) or ALL
AUTO-EXIT FEATURE.
14 SHIFT TAB "S" ( single mark )
15 TAB "S" ( single mark )
27 ESC ALL
** 30 HOME ALL
** 35 END ALL
** 40 INSERT ALL
34
Copyright(c) 1988-92 - By: CONNECT Software - All rights reserved.
** 45 DELETE ALL
** 50 MARK an entry "M"
** 55 UN-MARK an entry "M"
** Requires calling routine B4SCRL prior to calling
routine SCRLWIND. ( SEE ROUTINE B4SCRL ).
KEYATTR% is the color of the key character
for each item in the scroll window. If KEYATTR% = 0
the key character will be the same color as the other
characters for each window item. This would be
appropriate if the first character in each item is ALWAYS
the key character. KEYATTR% MUST EQUAL ZERO FOR A SCROLL
WINDOW TO BE A VIRTUAL SCROLL WINDOW. IF KEYATTR% = 0 THE
SCROLL WINDOW IS TREATED AS A VIRTUAL SCROLL WINDOW.
CHECKS TO DETERMINE IF THE ELEMENTS OF LIST$() ARE TOO
LONG TO FIT IN THE WINDOW ARE NOT MADE. Setting KEYATTR%
to a different color, or high intensity, allows users to
distinguish the character as the key character for each
item in the list. KEYATTR% has no effect on the
background color of an item when it is covered by the
scroll bar. It can effect the background color for the
key character. This is useful for computers without high
intensity or color capabilities. IF KEYATTR% <> 0 AND ANY
ELEMENTS OF LIST WILL NOT FIT IN THE SCROLL WINDOW
ALLOWING A LEADING AND TRAILING SPACE AN ERROR WILL BE
REPORTED. THEREFORE, IF KEYATTR% <> 0 THE SCROLL WINDOW
MAY NOT BE A VIRTUAL SCROLL WINDOW.
-------------------------------------------------------
'EXAMPLE OF A CALL TO SCRLWIND - AUTO EXIT SCROLL WINDOW
DIM LIST$(11), INFO$(11)
FOR X% = 1 TO 11 'ALWAYS START WITH 1.
READ LIST$(X%)
READ INFO$(X%) 'ONLY INCLUDE IF INFO-LINE
NEXT 'IS USED.
CALL MAKEWIND(15, "", 1, 1, 10, 13, 112, 2)
KIND$ = "A" : RTRN% = 3: KEYATTR% = 116: LI%=1: FC%=1
CALL SCRLWIND (LIST$(), INFO$(), "", 11, KIND$, RTRN%, LI%,
FC%, RKEY%, 116)
' THE ABOVE CALL TO SCRLWIND MUST BE TYPED ON ONE LINE IN
' QB/QBX.
DATA ONE : 'LIST$(1)
DATA INFO-LINE FOR ONE : 'INFO$(1)
DATA TW@O : 'LIST$(2)
' FOR ABOVE KEY CHAR. = "W"
35
Copyright(c) 1988-92 - By: CONNECT Software - All rights reserved.
DATA INFO-LINE FOR TWO : 'INFO$(2)
DATA TH@REE
' FOR ABOVE KEY CHAR. = "H"
DATA INFO-LINE FOR THREE
DATA FOUR
DATA INFO-LINE FOR FOUR
DATA FIV@E
' FOR ABOVE KEY CHAR. = "V"
DATA INFO-LINE FOR FIVE
DATA "-" : 'LIST$(5)
' ABOVE DATA STATEMENT PUTS A SEGMENTING LINE IN ROW 6
DATA "" : 'NULL IN INFO$(5)
DATA SIX@
' FOR ABOVE KEY CHAR. = "X"
DATA INFO-LINE FOR SIX
DATA SEVEN
DATA INFO-LINE FOR SEVEN
DATA EIGHT
DATA INFO-LINE FOR EIGHT
DATA NINE
DATA INFO-LINE FOR NINE
DATA TEN : 'LIST$(11)
DATA INFO-LINE FOR TEN : 'INFO$(11)
-------------------------------------------------------
The scroll window is the window defined by the call to
MAKEWIND as it is the active window when SCRLWIND is
called. The entries in the scroll window and the text for
the info-line are the items in the data statements, as
they are read into LIST$() and INFO$(). The fourth
parameter in the call to SCRLWIND is the number of items
in the list ( 11 ). As KIND$ ="A" before calling
SCRLWIND, the scroll window is an "AUTO-EXIT SCROLL"
window. Since RTRN% = 3 when entering SCRLWIND the scroll
bar will start over the third item ( THREE ). The sixth
DATA item for LIST$() loads LIST$(6) with "-". Therefore,
a line will print in row six of the scroll window. The
key character for each item will be red (KEYATTR% = 116 ).
RTRN% will equal the selected item, and RKEY% will
represent the exit key when SCRLWIND is exited. As
reading the data takes time, quicker scroll windows will
be generated if all arrays used in scroll windows are
filled using READ and DATA statement during program
initialization.
36
Copyright(c) 1988-92 - By: CONNECT Software - All rights reserved.
3.02 B4SCRL ( EXIT$, MARK$ )
Description: Sets the "exit keys" or "exit circumstances"
for a subsequent call to SCRLWIND. Sets the marked
( tagged ) entries for a subsequent call to SCRLWIND.
NOTE1: IT IS NOT NECESSARY TO CALL B4SCRL PRIOR TO CALLING
SCRLWIND UNLESS ONE OF B4SCRL'S FEATURES ARE REQUIRED.
NOTE2: B4SCRL ONLY AFFECTS THE NEXT CALL TO SCRLWIND FOR
ARGUMENTS EXIT$ AND MARK$. THEREFORE, IF B4SCRL IS
REQUIRED FOR A PARTICULAR SCROLL WINDOW IT MUST ALWAYS BE
CALLED PRIOR TO CALLING SCRLWIND FOR THAT SCROLL WINDOW.
ALWAYS PLACE A CALL TO B4SCRL, IF IT IS REQUIRED,
IMMEDIATELY BEFORE THE CALL TO SCRLWIND.
EXAMPLE: CALL B4SCRL (...... ' IF B4SCRL IS REQUIRED
CALL SCRLWIND (..... ' IT MUST PRECEDE SCRLWIND.
CALL SCRLWIND (.......' THE PREVIOUS CALL TO
' B4SCRL DOES NOT AFFECT
' THIS CALL TO SCRLWIND.
Arguments: EXIT$ sets the exit keys or exit
circumstances for a subsequent call to SCRLWIND.
Normally SCRLWIND exits via the ESC or ENTER keys. There
is no need to use B4SCRL to provide alternate means to
exit unless the scroll window requires same. EXIT$ may be
any combination of the following.
"E" The ESC key will exit SCRLWIND.
"R" The ENTER (RETURN) key will exit SCRLWIND.
"0" The F10 key will exit SCRLWIND.
"1" to "9" The F1 to F9 keys will exit SCRLWIND.
"I" The INSERT key will exit SCRLWIND.
"D" The DELETE key will exit SCRLWIND.
"X" This makes the scroll window an "EXTENDABLE"
scroll window. Any attempt to scroll past
the last entry ( PAGE DOWN or DOWN ARROW )
in the scroll window or scroll before the
first entry ( PAGE UP or UP ARROW ) in the
scroll window will exit SCRLWIND. The HOME
or END keys exit SCRLWIND. If the scroll
window is a multiple mark scroll window
( argument KIND$ for routine SCRLWIND equals
"M" ) any change in mark status of an entry
will exit SCRLWIND. ( FURTHER EXPLANATION
AND RESTRICTIONS FOLLOW. )
EXAMPLE: EXIT$ = "12DR" The F1, F2, DELETE, and ENTER
keys exit routine SCRLWIND.
37
Copyright(c) 1988-92 - By: CONNECT Software - All rights reserved.
NOTE1: IF EXIT$ CONTAINS AN "X" THE SCROLL WINDOW IS AN
"EXTENDABLE" SCROLL WINDOW. ALL ENTRIES MUST FIT IN THE
SCROLL WINDOW OR AN ERROR WILL BE REPORTED. IF THERE ARE
10 INTERIOR ROWS IN THE SCROLL WINDOW THE NUMBER OF
ENTRIES ( ARGUMENT ENTRIES% FOR ROUTINE SCRLWIND ) MUST BE
EQUAL TO, OR LESS THAN, 10.
NOTE2: IF THE INSERT OR DELETE KEYS ARE USED AS EXIT KEYS
AND THE SCROLL WINDOW IS A MULTIPLE MARK, EXTENDABLE,
SCROLL WINDOW THE INSERT AND DELETE KEYS WILL NO LONGER
MARK AND UN-MARK ENTRIES. THE "+" AND "-" KEYS WILL STILL
MARK AND UN-MARK ENTRIES, HOWEVER.
Placing an "X" in EXIT$ makes the scroll window an
"EXTENDABLE" scroll window. This provides the ability to
scroll through records in large random access, binary,
ISAM, BTRIEVE, or many other data files. On entry to
SCRLWIND memory constraints may prohibit placing all
records in a database in a scroll window. With
"EXTENDABLE" scroll windows, the first 15 records of a
data file may be placed in a scroll window with 15
interior rows.
NOTE: THE NUMBER OF INTERIOR ROWS IN A SCROLL WINDOW IS
EQUAL TO THE NUMBER OF ROWS IN THE WINDOW ( AS SET BY THE
CALL TO MAKEWIND FOR THE SCROLL WINDOW ) MINUS 2 IF THE
CALL TO MAKEWIND DID NOT SPECIFY A TITLE BOX. IF THE CALL
TO MAKEWIND SPECIFIED A TITLE BOX THE NUMBER OF INTERIOR
ROWS EQUALS THE ROWS SET BY THE CALL TO MAKEWIND MINUS 4.
An attempt to scroll past the 15th record in the scroll
window or before the first record in the scroll window
causes SCRLWIND to be exited. Argument RKEY% ( from
routine SCRLWIND ) can be used to determine the key or
circumstance which caused the exit. The following lists
the values returned by SCRLWIND's argument RKEY% which are
unique to "EXTENDABLE" scroll windows.
- RKEY% = 19 -- The DOWN ARROW was pressed ( SEE FOLLOWING
NOTE ) with the scroll bar on the last entry in the
scroll window. An attempt is being made to access the
next record ( relative to the last record in the scroll
window ) in the data file. On exit, a check should be
made to determine if the last record in the scroll
window is not the last record in the data file. If it
is not, all records in SCRLWIND's arguments LIST$()
should be shifted to the preceding element of LIST$().
The last element of LIST$() should be filled with the
next record.
38
Copyright(c) 1988-92 - By: CONNECT Software - All rights reserved.
( FILEPOINTER MUST = LAST RECORD IN SCROLL WINDOW )
( MAX = NUMBER OF RECORDS IN FILE )
( ENTRIES% = NUMBER OF ENTRIES IN THE WINDOW )
IF FILEPOINTER < MAX THEN
FILEPOINTER = FILEPOINTER + 1
FOR X% = 1 TO ENTRIES% - 1
SWAP LIST$(X%), LIST$(X% + 1)
NEXT
' DO WHAT YOUR DATABASE REQUIRES GET A RECORD AT
' POSITION FILEPOINTER.
LIST$(ENTRIES%) = THE RECORD
END IF
The scroll window should then be re-entered.
FILEPOINTER POINTS TO THE LAST RECORD IN THE SCROLL
WINDOW.
NOTE: RKEY% MAY ALSO EQUAL 19 IF THE SCROLL WINDOW IS A
MULTIPLE MARK, EXTENDABLE, SCROLL WINDOW AND A MARK KEY
( INS, DEL, +, or - ) IS PRESSED WITH THE SCROLL BAR ON
THE LAST ENTRY. IF THE ENTRY DOES NOT CHANGE "MARK"
STATUS RKEY% WILL EQUAL 19 EMULATING THE DOWN ARROW KEY.
IF THE ENTRY CHANGES "MARK" STATUS RKEY% WILL EQUAL 50 OR
55. SEE DESCRIPTIONS FOR RKEY% = 50 AND RKEY% = 55 TO SEE
HOW TO MOVE TO THE NEXT RECORD WHEN RKEY% = 50 OR RKEY% =
55.
- RKEY% = 16 -- The UP ARROW was pressed with the scroll
bar on the first entry in the scroll window. An attempt
is being made to access the preceding record ( relative
to the first record in the scroll window ) in the data
file. On exit, a check should be made to determine if
the first record in the scroll window is not the first
record in the data file. If it is not, all records in
SCRLWIND's arguments LIST$() should be shifted to the
next element of LIST$().
( FILEPOINTER MUST = FIRST RECORD IN SCROLL WINDOW )
( MAX = NUMBER OF RECORDS IN FILE )
( ENTRIES% = NUMBER OF ENTRIES IN THE WINDOW )
IF FILEPOINTER > 1 THEN
FILEPOINTER = FILEPOINTER - 1
FOR X% = ENTRIES% TO 2 STEP - 1
SWAP LIST$(X%), LIST$(X% - 1)
NEXT
' DO WHAT YOUR DATABASE REQUIRES GET A RECORD AT
' POSITION FILEPOINTER .
LIST$(1) = THE RECORD
END IF
39
Copyright(c) 1988-92 - By: CONNECT Software - All rights reserved.
The scroll window should then be re-entered.
FILEPOINTER POINTS TO THE FIRST ENTRY IN THE SCROLL
WINDOW.
- RKEY% = 11 -- The PAGE UP key was pressed. A check
should be made to determine if the are enough preceding
records in the data file to update LIST$(1) to
LIST$( INTERIOR ROWS IN THE SCROLL WINDOW ) with
preceding records ( relative to the first record in the
scroll window). If there are, LIST$() should be
refreshed with those records.
( FILEPOINTER MUST = FIRST RECORD IN SCROLL WINDOW )
( ROWS% = INTERIOR ROWS IN SCROLL WINDOW )
( MAX = NUMBER OF RECORDS IN FILE )
ENTRIES% WILL BE USED BY THE NEXT CALL TO SCRLWIND
TO SET THE NUMBER OF ENTRIES IN THE SCROLL WINDOW.
RTRN% WILL BE DETERMINE WHICH ENTRY WILL BE
HIGHLIGHTED ON THE NEXT CALL TO SCRLWIND.
FILEPOINTER = FILEPOINTER - ROWS%
( If there are not enough preceding records in the
scroll window FILEPOINTER should be set to the first
record. )
IF FILEPOINTER < 1 THEN FILEPOINTER = 1
ENTRIES% = 0
WHILE ENTRIES% < ROWS% AND ENTRIES% < MAX
ENTRIES%=ENTRIES% + 1
' DO WHAT YOUR DATABASE REQUIRES GET A RECORD AT
' POSITION FILEPOINTER .
LIST%(ENTRIES%)= THE RECORD
FILEPOINTER = FILEPOINTER + 1
WEND
FILEPOINTER = FILEPOINTER - 1
RTRN% = 1 ' HIGHLIGHT FIRST SCROLL WINDOW ENTRY.
The scroll window should then be re-entered.
FILEPOINTER POINTS TO THE LAST ENTRY IN THE SCROLL
WINDOW.
- RKEY% = 12 -- The PAGE DOWN key was pressed. A check
should be made to determine if the are enough records
( relative to the last record in the scroll window ) in
the data file to update LIST$(1) to LIST$( INTERIOR ROWS
IN THE SCROLL WINDOW ) with new records ( relative to
40
Copyright(c) 1988-92 - By: CONNECT Software - All rights reserved.
the last record in the scroll window ). If there are,
LIST$() should be refreshed with these records.
( FILEPOINTER MUST = LAST RECORD IN SCROLL WINDOW )
( ROWS% = INTERIOR ROWS IN SCROLL WINDOW )
( MAX = NUMBER OF RECORDS IN FILE )
ENTRIES% WILL BE USED BY THE NEXT CALL TO SCRLWIND
TO SET THE NUMBER OF ENTRIES IN THE SCROLL WINDOW.
RTRN% WILL BE DETERMINE WHICH ENTRY WILL BE
HIGHLIGHTED ON THE NEXT CALL TO SCRLWIND.
IF FILEPOINTER + ROWS > MAX THEN
FILEPOINTER = ( MAX - ROWS% + 1 )
IF FILEPOINTER < 1 THEN FILEPOINTER = 1
ELSE
FILEPOINTER = FILEPOINTER + 1
END IF
ENTRIES% = 0
WHILE ENTRIES% < ROWS% AND ENTRIES% < MAX
ENTRIES%=ENTRIES% + 1
' DO WHAT YOUR DATABASE REQUIRES GET A RECORD AT
' POSITION FILEPOINTER.
LIST%(ENTRIES%) = THE RECORD
FILEPOINTER = FILEPOINTER + 1
WEND
FILEPOINTER = FILEPOINTER - 1
RTRN% = ENTRIES%
The scroll window should then be re-entered.
FILEPOINTER POINTS TO THE LAST ENTRY IN THE SCROLL
WINDOW.
- RKEY% = 30 -- The HOME key was pressed. The scroll
window should be filled with the first records in the
data file.
( FILEPOINTER MUST = FIRST RECORD IN THE DATA FILE )
( ROWS% = INTERIOR ROWS IN SCROLL WINDOW )
( MAX = NUMBER OF RECORDS IN FILE )
ENTRIES% WILL BE USED BY THE NEXT CALL TO SCRLWIND
TO SET THE NUMBER OF ENTRIES IN THE SCROLL WINDOW.
RTRN% WILL BE DETERMINE WHICH ENTRY WILL BE
HIGHLIGHTED ON THE NEXT CALL TO SCRLWIND.
41
Copyright(c) 1988-92 - By: CONNECT Software - All rights reserved.
FILEPOINTER = 1
ENTRIES% = 0
WHILE ENTRIES% < ROWS% AND ENTRIES% < MAX
ENTRIES%=ENTRIES% + 1
' DO WHAT YOUR DATABASE REQUIRES GET A RECORD AT
' POSITION FILEPOINTER .
LIST%(ENTRIES%)=RECORD
FILEPOINTER = FILEPOINTER + 1
WEND
FILEPOINTER = FILEPOINTER - 1
RTRN% = 1 ' HIGHLIGHT FIRST SCROLL WINDOW ENTRY.
The scroll window should then be re-entered.
FILEPOINTER POINTS TO THE LAST RECORD IN THE SCROLL
WINDOW.
- RKEY% = 35 -- The END key was pressed. The scroll
window should be filled with the last records in the
data file.
( FILEPOINTER MUST BE SET TO THE CORRECT RECORD )
( ROWS% = INTERIOR ROWS IN SCROLL WINDOW )
( MAX = NUMBER OF RECORDS IN FILE )
ENTRIES% WILL BE USED BY THE NEXT CALL TO SCRLWIND
TO SET THE NUMBER OF ENTRIES IN THE SCROLL WINDOW.
RTRN% WILL BE DETERMINE WHICH ENTRY WILL BE
HIGHLIGHTED ON THE NEXT CALL TO SCRLWIND.
FILEPOINTER = MAX - ROWS% + 1
IF FILEPOINTER < 1 THEN FILEPOINTER = 1
ENTRIES% = 0
WHILE ENTRIES% < ROWS% AND ENTRIES% < MAX
ENTRIES%=ENTRIES% + 1
' DO WHAT YOUR DATABASE REQUIRES GET A RECORD AT
' POSITION FILEPOINTER .
LIST%(ENTRIES%)=RECORD#
FILEPOINTER = FILEPOINTER + 1
WEND
FILEPOINTER = FILEPOINTER - 1
RTRN% = ENTRIES% ' HIGHLIGHT LAST ENTRY.
The scroll window should then be re-entered.
FILEPOINTER POINTS TO THE LAST RECORD IN THE SCROLL
WINDOW AND IN THE DATA FILE.
42
Copyright(c) 1988-92 - By: CONNECT Software - All rights reserved.
- RKEY% = 50 -- The scroll window is a "MARK", extendable,
scroll window. An un-marked entry was marked. ( SEE
DESCRIPTION FOR ARGUMENT MARK$ FOR THIS ROUTINE ). To
determine which record was marked;
( FILEPOINTER MUST = FIRST RECORD IN SCROLL WINDOW )
( RTRN% IS RETURNED BY ROUTINE SCRLWIND. IT
POINTS TO THE "MARKED" ENTRY )
' DO WHAT YOUR DATABASE REQUIRES GET A RECORD AT
' POSITION FILEPOINTER + RTRN% - 1.
' UPDATE THE RECORD TO SHOW IT IS MARKED.
RTRN% = RTRN% + 1 ' MOVE TO THE NEXT ENTRY
IF RTRN% > ENTRIES% -- GO TO THE ROUTINE USED FOR
THE DOWN ARROW ( RKEY% = 16 )
The scroll window should then be re-entered.
FILEPOINTER POINTS TO THE FIRST RECORD IN THE SCROLL
WINDOW.
- RKEY% = 55 -- The scroll window is a "MARK" ( and
"EXTENDABLE" ) scroll window. An marked entry was un-
marked. ( SEE DESCRIPTION FOR ARGUMENT MARK$ FOR THIS
ROUTINE). To determine which record was marked;
( FILEPOINTER MUST = FIRST RECORD IN SCROLL WINDOW )
( RTRN% IS RETURNED BY ROUTINE SCRLWIND. IT
POINTS TO THE "MARKED" ENTRY )
' DO WHAT YOUR DATABASE REQUIRES GET A RECORD AT
' POSITION FILEPOINTER + RTRN% - 1.
' UPDATE THE RECORD TO SHOW IT IS NOT MARKED.
RTRN% = RTRN% + 1 ' MOVE TO THE NEXT ENTRY
IF RTRN% > ENTRIES% -- GO TO THE ROUTINE USED FOR
THE DOWN ARROW ( RKEY% = 16 )
The scroll window should then be re-entered.
FILEPOINTER POINTS TO THE FIRST RECORD IN THE SCROLL
WINDOW.
NOTE: "EXTENDABLE" SCROLL WINDOWS ONLY EXIT WITH RKEY%
EQUAL TO 50 OR RKEY% EQUAL TO 55 IF A CHANGE IN "MARK"
STATUS FOR AN ENTRY OCCURS. AN ATTEMPT TO MARK A
PREVIOUSLY MARKED ENTRY OR UN-MARK A PREVIOUSLY UN-
MARKED ENTRY WILL NOT EXIT ROUTINE SCRLWIND.
43
Copyright(c) 1988-92 - By: CONNECT Software - All rights reserved.
- RKEY% = 1 TO 10, 13, 27, 40, or 45 -- These values for
RKEY% are not unique to an "EXTENDABLE" scroll window.
They remain available as a means to exit an "EXTENDABLE"
scroll window, however. SEE ARGUMENT RKEY% FOR ROUTINE
SCRLWIND.
NOTE: WHEN A SCROLL WINDOW IS AN EXTENDABLE SCROLL WINDOW
IT'S OPTIONS ARE AFFECTED AS FOLLOWS:
1. PRESSING THE FIRST LETTER OF AN ENTRY OR "KEY
CHARACTER" OF AN ENTRY DOES NOT MOVE THE SCROLL BAR TO
THE ENTRY. AS THE SEARCH IS CONFINED TO THE ENTRIES IN
THE SCROLL WINDOW, AND ALL OF THE RECORDS ARE NOT IN
THE SCROLL WINDOW, "KEY CHARACTERS", ARE USELESS.
2. AUTO-EXIT SCROLL WINDOWS ARE NOT PERMITTED ALSO, FOR
THE SAME REASON. TO SEARCH FOR A RECORD, THE F1 KEY,
FOR EXAMPLE, CAN BE USED TO EXIT SCRLWIND AND PROMPT
THE USER FOR A SEARCH CRITERIA. THE DATABASE CAN BE
SEARCHED, AND IF A MATCH IS FOUND, SCRLWIND MAY BE RE-
ENTERED DISPLAYING THE "FOUND" RECORD.
3. THE OPTIONAL POSITION ARROW ON THE RIGHT BORDER OF THE
SCROLL WINDOW IS DISABLED FOR THE CALL TO SCRLWIND.
4. THE SPACE BAR ( PRINT KEY ON SOME SYSTEMS ) DOES NOT
MARK/UN-UNMARK ALL ENTRIES IN MULTIPLE MARK SCROLL
WINDOWS.
MARK$ is a string representing those entries,
on entering SCRLWIND, to be marked. This is only
appropriate if the scroll window is a multiple mark scroll
window ( SCRLWIND's argument KIND$ = "M" ). MARK$ must be
the exact length as the number of entries in the scroll
window. IF IT IS NOT IT IS IGNORED! On entry to routine
SCRLWIND a space ( CHR$(32) ) in MARK$ is decoded as an
un-marked entry. If the first character of MARK$ = " "
the first entry in the scroll window will not be marked.
An arrow ( CHR$(16) ) in MARK$ is decoded as a marked
entry. If the second character of MARK$ = CHR$(16) the
second entry in the scroll window is marked. Each
character in MARK$ represents a marked or un-marked entry
in the scroll window. On exit from routine SCRLWIND,
SCRLWIND's argument KIND$ holds the string representation
for those marked and un-marked items. B4SCRL's argument
MARK$ holds the string representation on entry only. If
the scroll window is to be re-entered it is necessary to
refresh MARK$. The following example demonstrates this.
REENTER:
KIND$ = "M" ' MAKE A MULTIPLE MARK SCROLL WINDOW
44
Copyright(c) 1988-92 - By: CONNECT Software - All rights reserved.
CALL B4SCRL ("", MARK$ ) ' ENTER WITH SOME ENTRIES
' MARKED.
' WHILE IN THE SCROLL WINDOW ENVIRONMENT THE MARKED
' ENTRIES MAY CHANGE.
CALL SCRLWIND ( L$(), I$(), TL$, ENTRIES%, KIND$ ........
' KIND$ REPRESENTS THE MARKED ENTRIES ON EXIT
MARK$ = KIND$ ' MARK$ MUST BE REFRESHED IF THE SCROLL
' WINDOW IS TO BE RE-ENTERED
' KIND$ = "" IF NOTHING WAS MARKED. IF LENGTH OF MARK$ IS
' NOT ENTRIES% LONG IT IS IGNORED, THEREFORE ON RE-ENTRY
' NO ENTRIES ARE MARKED.
GOTO REENTER
NOTE: IT IS THE PROGRAMMER'S RESPONSIBILITY TO ASSURE
MARK$ CONTAINS SPACES ( " " ) AND ARROWS ( CHR$(16) )
ONLY. ANY OTHER CHARACTERS WILL MARK ENTRIES WITH THAT
CHARACTER ON ENTRY ONLY. IF THE ENTRY IS UN-MARKED AND
RE-MARKED IN THE SCROLL WINDOW ENVIRONMENT THE NORMAL MARK
CHARACTER IS USED.
3.03 MARKED% (KIND$, START%)
Description: MARKED%(KIND$, START%) is a function used
to decode SCRLWIND's argument KIND$ after a multiple mark
scroll window is exited. MARKED%(KIND$, START%) will equal
the next position in KIND$ starting from position START%
which contains a CHR$(16). If the third element (item)
in LIST$() was marked in the call to SCRLWIND and START%
=1, THEN: MARKED%(KIND$,START%) = 3.
Arguments: KIND$ is the string returned by calling
SCRLWIND with the MARKED option ON. KIND$ = "" if no
items were marked.
START% is the position in KIND$ to start
searching for a CHR$(16). A CHR$(16) in KIND$
represents a marked element in the string array LIST$()
used in SCRLWIND. Every time a position in KIND$ is
found which corresponds to a marked element of LIST$(),
START% is set to a new value which is equal to the
"marked" position in KIND$ + 1. This is the next
position in KIND$ where the search will start for
another "marked" position. If MARKED% =0 there are no
more "marked" positions in KIND$ or KIND$ = "".
45
Copyright(c) 1988-92 - By: CONNECT Software - All rights reserved.
-------------------------------------------------------
'EXAMPLE USING THE FUNCTION MARKED% (KIND$,START%) THIS
'EXAMPLE PRINTS THE MARKED ITEMS IN LIST$() AFTER A CALL
'TO SCRLWIND.
'GIVEN: SCRLWIND HAS BEEN CALLED. THE FOURTH AND TENTH
'ELEMENTS OF LIST$() WERE MARKED. KIND$ WAS RETURNED BY
'A PREVIOUS THE CALL TO SCRLWIND.
DECLARE FUNCTION MARKED% (KIND$, START%) ' MUST BE IN
'(Put this at the start of the module) ' MODULE USING
' FUNC. MARKED%.
START%=1 ' START THE SEARCH AT POSITION 1 OF KIND$.
DO ' MARKED% = 0 AFTER
A% = MARKED%(KIND$, START%) ' ALL MARKED ITEMS
IF A% = 0 THEN EXIT DO ' ARE FOUND OR IF
PRINT LIST$(A%)
END IF
LOOP
-------------------------------------------------------
The first time through the loop, MARKED% (KIND$, START%)
will equal 4, and LIST$(4) will print. START% is auto-
matically set to 5, the next position to start searching
KIND$ for a "marked" position in KIND$. The second loop
will set MARKED% (KIND$,START%) to 10 and LIST$(10) will
print. As there are no more marked positions, MARKED% =
0 and the loop be exited.
46
Copyright(c) 1988-92 - By: CONNECT Software - All rights reserved.
***** GET ANSWER WINDOWS *****
This routine pauses the program, prompts the user, and waits
for the user to press a key. The key may be any key, or an
individual key from a list of permissible keys. The prompt
may, optionally, be windowed. The area covered by prompt and
window, if one exists, is restored after the key or ENTER is
pressed.
NOTE: THERE ARE TWO MODES OF OPERATION FOR THIS ROUTINE. SEE
THE DESCRIPTION FOR THE ARGUMENT ANS$ FOR DETAILS.
4.00 GETANS (PROMPT$, CHOICE$, ANS$, TR%, LC%, ATTR%, BORDER%)
Description: Generates a prompt with an optional window
and pauses, waiting for a single key reply. Pressing ENTER
to finalize the selection is optional.
Arguments: PROMPT$ is the prompt ( i.e. Press any key )
or question ( i.e. Are you sure? Y/N ). It may be
optionally windowed ( SEE BORDER% ). The width of the
window is determined by the length of PROMPT$. If
PROMPT$ is too long making the window, or prompt, too
wide to fit on the screen an error will be reported.
CHOICE$ is the valid keys the user can
press to exit GETANS. If CHOICE$ = "" any key will
exit. This would be appropriate if PROMPT$ = "Press any
key". If CHOICE$ = "YN" then the "Y", "y", "N" or
"n" keys will exit GETANS. The ESC key will always exit
regardless of CHOICE$.
ANS$ serves two purposes. On entry ANS$
determines the mode of operation for routine GETANS.
There are two modes of operation for this routine.
1. If argument ANS$ = "" on entry, as soon as a valid key
is pressed the routine is exited.
EXAMPLE: ANS$ = ""
CALL GETANS ( PROMPT$, "YN", ANS$ ......
As soon a "Y" or "N" is pressed the routine is exited
with the key pressed returned in ANS$
2. If argument ANS$ equals any letter on entry the letter
is displayed in the get answer window to the right of
the prompt. The user may press any valid key
predicated on argument CHOICE$. The letter represented
by the valid key is displayed in the get answer window.
The user must press ENTER to accept the choice.
47
Copyright(c) 1988-92 - By: CONNECT Software - All rights reserved.
EXAMPLE: ANS$ = "N"
CALL GETANS ( PROMPT$, "YN", ANS$........
On entry an "N" will appear after the prompt. If a
"Y" is pressed it will appear after the prompt. The
user must press ENTER to exit the routine with the
displayed letter returned in ANS$.
On exit ANS$ holds the key pressed. It is returned in
upper case. If CHOICE$ = "" then ANS$ = "". If ESC is
pressed CHR$(27) is always returned in ANS$.
TR% is the top row. See MAKEWIND
LC% is the left column. See MAKEWIND
ATTR% is the color designation. See
MAKEWIND. Although it is permissible to set ATTR% > 127
to make the border flash the text will not flash. If ANS$
equals a letter, on entry, the letter is displayed next to
the prompt. The color of this letter is the inverse of
the color of the get answer window. If the window has a
white background with a black foreground the displayed
letter will have a black background with a white
foreground. To make the foreground color of the displayed
letter high intensity add 1000 to ATTR%
EXAMPLE: ANS$ = "N": ATTR% = 1112 ( 1000 + 112 )
The get answer window is white with a black foreground.
The "N" has a black background. As 1000 is added to
ATTR% the foreground for the "N" is high intensity white.
BORDER% is the window's border designation.
Title boxes ( BORDER% > 42 ) are not permitted. Set
BORDER% to 0 for no window ( prompt only ). SEE THE
BORDER DESIGNATION CHART.
EXAMPLE OF A CALL TO GETANS:
ANS$ = ""
CALL GETANS ("Are you sure? Y/N", "YN", ANS$, 100, 100,
240, 11)
( Above must be on one line. )
A window will be generated with the text "Are you sure?
Y/N" printed in it. With TR% and LC% set to 100 the
window will be centered on the screen ( See MAKEWIND ).
ATTR% = 240, therefore, the window will be white with
black text and a black flashing border. The user may
press the N, n, Y, y, or ESC keys to exit. The key
pressed will be returned to GETANS in the argument ANS$.
48
Copyright(c) 1988-92 - By: CONNECT Software - All rights reserved.
***** INPUT ROUTINES *****
Input routines provide the ability to generate a single input
field ( INPTWIND ), or multiple input fields ( MULTINPT ).
Full editing is provided within each field. Up to 10 multiple
input screens may be used, with each screen capable of
supporting up to 150 fields. Fields may be defined as numeric,
alpha/numeric, or date. Numeric fields may be designated 0 to 6
decimal places and optionally padded with leading zeros.
Numerous additional options are available.
5.00 INPTINIT ( DATEFORMAT%, ISDOT%, INPUTEXIT$ )
See: Example - Input window
Description: Initialization routine for input routines
INPTWIND and MULTINPT. INPTINIT MUST BE CALLED ONCE IN
EVERY PROGRAM BEFORE ANY CALLS TO ROUTINES INPTWIND AND
MULTINPT.
NOTE: IF A CLEAR STATEMENT IS EXECUTED BY THE PROGRAM
INPUT INITIALIZATION MEMORY IS LOST. INPTINIT MUST BE
CALLED AFTER A CLEAR STATEMENT TO RE-INITIALIZE INPUT
INITIALIZATION MEMORY.
Arguments: DATEFORMAT% sets the valid date format for
input routines INPTWIND and MULTINPT. If a field in
either input routine is designated a date field, the field
can not be exited if the entered date does not match the
date format as specified by DATEFORMAT%. The valid date
format varies predicated on the specified field width for
the date field. If set outside it's allowable range,
DATEFORMAT% defaults to 1. Listed are valid values for
DATEFORMAT% and the corresponding valid date formats.
DATEFORMAT% DATE FORMAT DATE FORMAT
(FIELD WIDTH = 10) (FIELD WIDTH = 8)
1 MM-DD-YYYY MM-DD-YY
2 MM/DD/YYYY MM/DD/YY
3 DD-MM-YYYY DD-MM-YY
4 DD/MM/YYYY DD/MM/YY
5 DD.MM.YYYY DD.MM.YY
ISDOT% sets a period or comma for the decimal
designator. If ISDOT% = 1 the decimal designator is a
period. If ISDOT% <> 1 the decimal designator is a comma.
This is appropriate for some users outside of the USA.
INPUTEXIT$ set the keys which will exit input
routine INPTWIND. INPUTEXIT$ does not affect input
routine MULTINPT. Routine SETINPT is used to set exit
49
Copyright(c) 1988-92 - By: CONNECT Software - All rights reserved.
keys for input routine MULTINPT. If INPUTEXIT$ = "" the
default keys will exit INPTWIND. These are ESC and ENTER.
ESC will exit INPTWIND returning the pre-edited text.
ENTER exits INPTWIND returning the edited text. Using
INPUTEXIT$ allows key trapping while in the INPTWIND
environment. INPUTEXIT$ may consist of any combination of
the following characters.
Character "Exit" key.
"0" F10
"1","2","3","4","5","6","7","8","9" F1 to F9
"E" ESC
"R" RETURN (ENTER)
"U" PGUP
"D" PGDN
Example: If INPUTEXIT$ = "02ER" the F10, F2, ESC, and
RETURN (ENTER) keys will exit INPTWIND. see the
description for routine INPTWIND ( argument RKEY% ).
NOTE: IF THE ESC KEY IS NOT AN EXIT KEY AND INPUTEXIT$
DOES NOT EQUAL "" THE ESC KEY WILL RETURN THE TEXT IN THE
INPUT FIELD TO IT'S PRE-EDITED STATE. INPTWIND WILL NOT BE
EXITED. IF THE ESC KEY IS AN EXIT KEY INPTWIND IS EXITED
RETURNING THE EDITED TEXT, WHEN ESC IS PRESSED.
5.01 INPTWIND (P$,CODE$,TR%,LC%,WD%,ATTR%,RES$,RTRN$,RKEY%,BRDR%)
See: Example - Input window
NOTE1: ROUTINES INPTINIT AND SETWIND MUST BE CALLED AT LEAST
ONCE IN ANY PROGRAM PRIOR TO CALLING THIS ROUTINE.
NOTE2: WHEN AN INPUT WINDOW ( OR LINE ) IS MADE IT BECOMES
THE ACTIVE INPUT WINDOW UNTIL IT IS DEACTIVATED BY A CALL
TO ROUTINE RSTRINPT. ON ENTRY THIS ROUTINE WILL MAKE A
NEW INPUT WINDOW IF THERE IS NO ACTIVE INPUT WINDOW. IF
THERE IS AN ACTIVE INPUT WINDOW THIS ROUTINE SIMPLY RE-
ENTERS IT. A NEW INPUT WINDOW IS NOT MADE. AN
UNDERSTANDING OF ROUTINE RSTRINPT IS NECESSARY TO FULLY
UNDERSTAND THIS ROUTINE.
Description: On entry this routine will do one of the
following.
1. IF THERE IS NO ACTIVE INPUT WINDOW this routine makes
an input field, which may optionally be windowed. The
area under the field or window is automatically saved.
The input window becomes the active input window.
The area under the window ( or line ) can be restored
50
Copyright(c) 1988-92 - By: CONNECT Software - All rights reserved.
after exiting INPTWIND by calling routine RSTRINPT.
RSTRINPT also deactivates the active input window.
2. IF THERE IS AN ACTIVE INPUT WINDOW calling INPTWIND re-
enters it. Arguments for top row (TR%), left column
(LC%), field width (WD%) and color (ATTR%) are ignored.
A new input window is NOT made. The active input
window ( from a previous call to INPTWIND ) is used and
MUST be intact. The following outlines the suggested
use for routines INPTWIND and RSTRINPT.
A. Call INPTWIND. Enter data and exit.
B. Check the data.
C. If the data is good proceed to step D. If the data
is not good go back to step A. As RSTRINPT has not
been called the input window is still active. A
new input window will not be made. The existing
active input window is simply re-entered.
D. Call RSTRINPT. The active input window made in
step A is deactivated by RSTRINPT. The display
area covered by the input window may optionally be
restored. The next call to INPTWIND will make a
new input window as an active input window will not
exist.
IF AN ACTIVE INPUT WINDOW UNKNOWINGLY EXISTS ON ENTRY TO
INPTWIND THE ACTIVE INPUT FIELD WILL BE DISPLAYED. THE
INPUT WINDOW WILL NOT BE DISPLAYED. THE LOCATION OF THE
FIELD WILL BE THE LOCATION SET BY THE ACTIVE INPUT WINDOW.
THE COORDINATES IN THE CALL TO INPTWIND ARE IGNORED. IF
AN INPUT FIELD IS PLACED AT AN UNEXPECTED SCREEN LOCATION
ON A CALL TO INPTWIND AN ACTIVE INPUT WINDOW PROBABLY
EXISTS WHEN IT IS NOT EXPECTED TO EXIST.
Arguments: P$ is the message ( prompt ) which will be
printed to the left of the input field or in the title
box of the window, if one is specified. If P$ is
preceded by a "@" it will be centered in the title box.
CODE$ sets the type of input field and may
equal the following.
"A" ------ Alpha/numeric. All standard keys are active.
"U" ------ Alpha/numeric. Upper case.
"L" ------ Alpha/numeric. Lower case.
"D" ------ Date. If a field is a date field it can not
be exited unless the date is valid or the
field is blank. The number keys are active.
51
Copyright(c) 1988-92 - By: CONNECT Software - All rights reserved.
Depending on the date format specified in
the call to INPTINPT, the ".", "/" or "-"
key will be active also. Valid dates range
from 01/01/1901 to 12/31/2099 if the width
of the date field is 10, or 01/01/01 to
12/31/99 if the width of the date field is
8. SEE DESCRIPTION FOR DATEFORMAT% IN
ROUTINE "INPTINIT".
"P0" or "0" - Numeric. The value of the string desig-
"P1" or "1" nates the number of decimal places that
"P2" or "2" will be returned, even if more are
"P3" or "3" entered. The field can not be exited
"P4" or "4" unless the number, with the correct
"P5" or "5" number of decimal places will fit in the
"P6" or "6" the field. or the field is blank. The
numeric,"-", and "." keys are active. The
minus sign will only print in the first
position of the field. If a decimal point
is in the field another one can not be
entered until the previous one is deleted.
NOTE: A NUMERIC FIELD WILL BE PADDED WITH LEADING ZEROS
IF CODE$ CONTAINS A "P."
EXAMPLE: CODE$ = "3P" --- This allows numeric input. It
will return the data expanded, or truncated to, 3 digits
after the decimal point and padded with leading zeros.
TR% is the top row of the field or window.
If a window is designated, TR% must equal 1 to 23.
Without a window TR% must equal 1 to 25. Setting TR%
to 100 centers the field, or window, top to bottom.
LC% is the left column. If a window is
designated, LC% must equal 1 to 76 ( 36 in 40 column
mode ). With no window LC% must equal 1 to 79 ( 39 in
40 column mode ). If LC% = 100 the field, or window, is
centered left to right. If LC% is set so the input
field with a window, if specified, or with a prompt, if
specified, will not fit on the screen an error will be
reported.
WD% is the field's width. A date field must
have WD%=10 or WD%=8. A numeric field requires WD% to
be from the number of ( decimal places + 1 ) to 15.
For an alpha/numeric field WD% can range from 1 to the
screen width minus 1 ( minus 4 if windowed ).
ATTR% is the window's and prompt's color.
The color of the input field is the inverse of the
window's color. The field's foreground color is the
52
Copyright(c) 1988-92 - By: CONNECT Software - All rights reserved.
same as the window's background color while the field's
background has the same color as the windows foreground.
SEE THE COLOR ATTRIBUTE CHART. To make the field's
foreground color high intensity, add 1000 to ATTR%.
EXAMPLE: ATTR% = 1160. ( 1000 + 160 ) The "160"
produces a flashing black on green window. ( SEE THE
COLOR ATTRIBUTE CHART. ). The "1000" makes the field
text high intensity green.
RES$ is the restrict string. It holds the
allowable characters which can be entered in the input
field. RES$ IS IGNORED IF CODE$ IS NOT ALPHA/NUMERIC
("A"). IF CODE$ IS ALPHA/NUMERIC ("A") AND RES$ = ""
ALL STANDARD ALPHA/NUMERIC KEYS ARE ALLOWABLE. (SEE
SETINPT IN SECTION 5.03 FOR DETAILS.)
RTRN$ is the string passed to, and returned
from the input field. A numeric string can be converted
to a number by using the VAL function.
EXAMPLE: IF RTRN$= "123.123" IT CAN BE CONVERTED TO A
NUMBER (A) WITH THE STATEMENT:
A = VAL(RTRN$)
A now equals 123.123
RKEY% is returned by INPTWIND. RKEY%
represents the key used to exit INPTWIND and is restricted
to those keys specified in the call to INPTINIT ( argument
INPUTEXIT$ ). RKEY% may equal the following
RKEY% KEY WHICH EXITED INPTWIND
1 to 10 F1 to F10
11 PGUP
12 PGDN
13 ENTER ( RETURN )
27 ESC
BRDR% is the input window's border. ( SEE
THE BORDER DESIGNATION CHART ). If BRDR% = 0 a single
line input field ( no window ) is generated. If BRDR%
produces a title box window, the prompt (P$) is printed
in the title box.
5.02 RSTRINPT ( RESTOREFLAG% )
See: Example - Input window
Description: Used to deactivate the active input window
53
Copyright(c) 1988-92 - By: CONNECT Software - All rights reserved.
generated by a call to routine INPTWIND. Optionally
restores the display area under the input window. After a
call to INPTWIND an active input window exists.
Subsequent calls to INPTWIND behave differently if, on
entry, an active input window exists.
Argument: RESTOREFLAG% must equal 1 to restore the
display area ( saved by routine INPTWIND ) under the
active input window. If RESTOREFLAG% equals 0 the
area under the active input window is not restored to the
display. REGARDLESS OF THE VALUE OF RESTOREFLAG% ALL
CALLS TO RSTRINPT DEACTIVATE THE ACTIVE INPUT WINDOW.
EXAMPLES:
1. CALL RSTRINPT (1) 'DEACTIVATES ACTIVE INPUT WINDOW
'AND RESTORES DISPLAY AREA UNDER IT.
2. CALL RSTRINPT (0) 'DEACTIVATES ACTIVE INPUT WINDOW.
NOTE1: IF AN INPUT WINDOW REMAINS ON THE DISPLAY AND IT IS
NOT THE ACTIVE INPUT WINDOW, RSTRINPT CAN NOT RESTORE THE
DISPLAY AREA UNDER IT. RSTRINPT CAN ONLY RESTORE THE
DISPLAY AREA UNDER THE ACTIVE INPUT WINDOW.
NOTE2: THE ACTIVE INPUT WINDOW ( THE SAVED DISPLAY AREA )
RESIDES IN WINDOW NUMBER 21. FUNCTION WAVAIL% CAN
DETERMINE IF AN INPUT WINDOW IS ACTIVE.
EXAMPLE: IF WAVAIL%(21) = 0 ' An input window is active.
IF WAVAIL%(21) = 1 ' An input window is not
' active.
54
Copyright(c) 1988-92 - By: CONNECT Software - All rights reserved.
-----------------------------------------------------------------
' SAMPLE: Input window
' IT IS ASSUMED ROUTINE SETWIND HAS BEEN CALLED.
' BEFORE ANY CALLS TO INPTWIND, INPTINIT MUST BE CALLED.
' DATE FORMAT = "MM-DD-YYYY" OR "MM-DD-YY"
' DECIMAL DESIGNATOR IS A "."
' RETURN (ENTER) OR ESC WILL EXIT INPTWIND.
CALL INPTINIT ( 1, 1, "" )
'
'
GETINPUT:
' NUMERIC INPUT - 0 DECIMAL PLACES.
' INPUT WINDOW CENTERED ROW AND COLUMN.
' FIELD WIDTH = 2.
' HIGH INTENSITY WHITE ON BLACK.
' WINDOWED WITHOUT A TITLE BOX - PROMPT TO LEFT OF INPUT FIELD.
' THE FOLLOWING CALL TO INPTWIND MUST BE ON ONE LINE IN THE QB/QBX
' EDITOR.
CALL INPTWIND ("Enter a number 1 to 50: ", "0", 100, 100, 2, 15,
"", RTRN$, RKEY%, 1 )
' RKEY% REPRESENTS KEY USED TO EXIT INPTWIND .
' RTRN$ IS THE ENTERED TEXT.
IF RKEY% = 27 THEN PRINT "ESC PRESSED" :END ' ESC EXITED
R% = VAL(RTRN$)
' WAS BAD INPUT. GO BACK TO INPTWIND. AS RSTRINPT HAS NOT BEEN
' CALLED THE INPUT WINDOW REMAINS ACTIVE. IT WILL NOT BE RE-
' PRINTED. IT IS RE-ENTERED ONLY.
IF R% < 1 OR R% > 50 THEN BEEP: GOTO GETINPUT ' BAD INPUT
' WAS GOOD INPUT - RSTRINPT DEACTIVATES ACTIVE INPUT WINDOW AND
' RESTORES DISPLAY AREA UNDER SAME.
' *** IF RSTRINPT IS NOT CALLED, ON THE NEXT CALL TO INPTWIND AN
' *** ACTIVE INPUT WINDOW WILL STILL EXIST. INPTWIND WILL IGNORE
' *** VALUES FOR TOP ROW, LEFT COLUMN, WIDTH AND COLOR AND USE THE
' *** VALUES FROM THE ACTIVE INPUT WINDOW. FORGETTING TO CALL
' *** RSTRINPT TO DEACTIVATE AN ACTIVE INPUT WINDOW MAY THEREFOR
' *** PRODUCE UNEXPECTED RESULTS.
CALL RSTRINPT (1)
LOCATE 1, 1
PRINT RTRN$ +" WAS ENTERED!"
END
-----------------------------------------------------------------
55
Copyright(c) 1988-92 - By: CONNECT Software - All rights reserved.
5.03 SETINPT ( SCRN%, COLWID%, EXIT$, INPT%(), INPT$(), ACTCOL% )
Description: Defines a multi-field input screen, which may
be utilized by a subsequent call to routine MULTINPT.
Arguments: SCRN% is the number or the screen being
defined. SCRN% may range from 1 to 10.
COLWID% is the column width of the screen
and must equal 40 or 80.
EXIT$ is the code for keys which will
exit the multi-field input routine for the designated
screen number. To make the function keys active place
their number "1","2" etc in EXIT$. A "0" represents
the F10 key, a "D" the PGDN key , a "U" the PGUP key and
an "E" the ESC key.
EXAMPLE: IF EXIT$ ="03U" THE F10, F3, OR PGUP KEYS WILL
EXIT THE MULTI-FIELD INPUT ROUTINE ( MULTINPT ).
NOTE: If the ESC key is not used as an exit key it is
used to return the text in a field in MULTINPT to it's
pre-edited state. This feature is disabled when ESC is
used as an exit key. The SPACE BAR can also be an exit
key for individual fields in MULTINPT if a field is a
FIXED CHOICE field. See the description for argument
INPT%(), element CODE%, in this routine to use FIXED
CHOICE fields.
INPT%() and INPT$() hold the data
representing the parameters for each field in the multi-
field input screen. Starting at INPT%(1) and INPT$(1),
the elements of INPT%() AND INPT$() are as follows;
------------ INPT%() ---------- -INPT$()-
1 2 3 4 5 6 1
(Field #1) CODE%, TR%, LC%, WD%, ATTR%, 99, RES$
(Field #2) ...... Repeat above for each field
9999 ( signals end of INPT%()/INPT$() )
INPT%(1)=CODE% FOR FIELD 1, INPT%(7)=CODE% FOR FIELD 2
INPT$(1)=RES$ FOR FIELD 1, INPT$(2)=RES$ FOR FIELD 2
CODE% is the code for type of input field
and can be set to any of the following.
0 to 6 ----- The field is numeric with the indicated
number of decimal places.
10 to 16 --- The field is numeric with padded zeros.
56
Copyright(c) 1988-92 - By: CONNECT Software - All rights reserved.
Subtract 10 to obtain the number of decimal places.
7 ---------- The field is alpha/numeric.
8 ---------- The field is a date field.
17 --------- The field is alpha/numeric. (upper case)
27 --------- The field is alpha/numeric. (lower case)
SEE ROUTINE "INPTWIND", ARGUMENT CODE$, FOR A DESCRIP-
TION AND INPUT LIMITATIONS FOR FIELDS BASED ON THEIR
DESIGNATION.
Adding 100 to CODE% makes the field protected. A
protected field will be displayed but can not be
edited. A protected field can not be an Auto-advance
or Auto-exit field. If a protected field is defined as
an Auto-exit or Auto-advance field the definition is
ignored and the field remains a protected field.
Adding 1000 to CODE% makes the field an Auto-advance
field. When the cursor reaches the end of an Auto-
advance field, via typing a character, it moves to the
next field. ( User defined order. )
Adding 10000 to CODE% makes the field an "Auto-exit
always" field. The multi-field input routine will be
exited whenever the cursor is moved from an "Auto-exit
always" field.
Adding 20000 to CODE% makes the field an "Auto-exit on
change" field. The multi-field input routine will be
exited only when the data in the field is changed and
the cursor is moved from the field. This is useful if a
field is part of a formula to calculate another fields
value.
Adding 30000 to CODE% makes the field a "Fixed choice"
field. The multi-field input routine will be exited if
the space bar is pressed or if the cursor is moved from
a "fixed choice" field. This also makes the field an
auto-exit (always) field. The description for the
procedure MULTINPT describes the details of a "fixed
choice" field.
EXAMPLE: If CODE%= 21017 THEN CODE% = 20000+1000+17.
THE FIELD IS ALPHA/NUMERIC ( UPPER CASE ), AUTO-ADVANCE
AND "AUTO-EXIT ON CHANGE".
** SEE THE MULTI-FIELD CODE CHART IN THE APPENDIX.**
TR%, LC%, and WD% are the same as in
INPTWIND.
57
Copyright(c) 1988-92 - By: CONNECT Software - All rights reserved.
ATTR% is the fields color.
99 is a check and must follow the numeric
data which defines each field.
RES$ defines the allowable characters
in a restricted field. If the field is not set to
alpha/numeric by CODE%, RES$ is ignored. Setting RES$ to
"YN" and CODE% TO 17 ( UPPER CASE ) allows the field to
respond to Y,y,N or n. If CODE% = 7 ( UPPER AND LOWER
CASE ) and RES$ ="YN" the field is restricted to Y or N.
IF CODE%=27 ( LOWER CASE ) and RES$ ="YN" the field will
not allow any characters. If RES$ = "" the field is not
restricted and will respond to characters predicated on
the value of CODE%.
NOTE: IT IS ONLY NECESSARY TO USE RES$ FOR NON-STANDARD
FIELDS. SET RES$ TO "" FOR NORMAL ALPHA/NUMERIC FIELDS
OR THE RESULT WILL BE EXTRA CODE AND MEMORY USAGE. IF
THE FIELD IS STANDARD ALPHA/NUMERIC MAKE CODE% = 7 AND
RES$ = "". THIS WILL ALLOW UPPER/LOWER CASE ALPHA/NUM-
ERIC INPUT.
EXAMPLE: RES$ = "0123456789-( )"
THIS RESTRICTS INPUT TO CHARACTERS INCLUDED IN
A PHONE NUMBER WITH THE AREA CODE.
ACTCOL% is the color attribute of the active
input field. Use ACTCOL% to make the active field a
different color than the inactive fields. If ACTCOL% = 0,
ACTCOL% is ignored and the active field's color will not
change. ACTCOL% is adjusted to ACTCOL% MOD 128.
-------------------------------------------------------
'EXAMPLE OF A CALL TO SETINPT
A% = 20: B% = 3 ' SET UP TEMPORARY ARRAYS FOR DATA.
DIM INPT% (A%), INPT$(B%) ' USE THIS METHOD SO ARRAY WILL BE
' DYNAMIC AND CAN BE DE-ALLOCATED
' LATER. DON'T USE DIM INPT%(20)
FLD% = 1
B% = 1 ' ALWAYS START THE ARRAYS AT 1
DO ' OR THE FIRST FIELD WILL BE
READ INPT%(B%) ' LOST.
IF INPT%(B%)=9999 THEN EXIT DO ' 9999 MARKS THE END
B% = B% + 1
FOR X% = 1 TO 5
READ INPT%(B%) ' READ REMAINING NUMERIC DATA
B% =B% + 1 ' IN INPT%(). TR%,LC%,WD%
58
Copyright(c) 1988-92 - By: CONNECT Software - All rights reserved.
NEXT ' ATTR% AND THE CHECK (99).
READ INPT$(FLD%) ' THEN READ INPT$() DATA FOR
FLD% = FLD% + 1 ' RESTRICTED FIELDS.
LOOP
DATA 0,1,1,15,112,99,""
' NUMERIC - TR%=1, LC%=1, WD%=15, ATTR%=112, CHECK MUST=99
' NOT RESTRICTED. THIS IS FIELD #1 (1st DATA STATEMENT)
DATA 17,3,1,1,112,99,"YN"
' ALPHA/NUM ( UPPER CASE ) TR%=3, LC%=1, WD%=1, ATTR%=112
' CHECK MUST=99, RESTRICTED TO Y,N,y,or n.
' THIS FIELD #2 (2nd DATA STATEMENT)
DATA 108,5,1,10,32,99,""
' PROTECTED DATE - TR%=5, LC%=1 WD%=10, ATTR%=32
' CHECK MUST = 99', NOT RESTRICTED
' THIS IS FIELD #3 (3rd DATA STATEMENT)
DATA 9999
' 9999 MARKS THE END
CALL SETINPT( 1, 80, "12", INPT%(), INPT$(), 15 )
ERASE INPT%, INPT$ ' GET THE MEMORY BACK
'------------------------------------------------------
' THE MULTI-FIELD INPUT SCREEN (#1) IS 80 COLUMNS WIDE
' AND WILL BE EXITED IF THE F1 OR F2 KEYS ARE PRESSED.
' THERE ARE 3 FIELDS AS PER THE DATA STATEMENTS. A CALL
' TO MULTINPT WILL DISPLAY THE FIELDS AND WAIT FOR
' INPUT. INPUT ENDS WHEN THE F1 OR F2 KEYS ARE PRESSED.
' THE ACTIVE FIELD WILL BE HIGH INTENSITY WHITE ON BLACK.
'-------------------------------------------------------
5.04 MULTINPT ( SCRN%, TOFLD%, CODE$, AUTOEXIT%, RKEY%, RTRN$() )
NOTE1: ROUTINES INPTINIT AND SETWIND MUST BE CALLED AT LEAST
ONCE IN ANY PROGRAM PRIOR TO CALLING THIS ROUTINE.
Description: Displays input fields defined in a previous
call to SETINPT. Fields are available for full editing
Returns edited strings to the calling program.
Arguments: SCRN% is the number ( 1 to 10 ) of the
multi-field input screen to display.
TOFLD% serves two purposes.
1. When entering MULTINPT, TOFLD% determines which field
will be the active field ( the one with the cursor ).
59
Copyright(c) 1988-92 - By: CONNECT Software - All rights reserved.
It may range from one to the last field as designated
by SETINPT.
2. When exiting MULTINPT, TOFLD% points to the next field
the cursor would normally occupy. If a field is auto-
exit ( always ) and the down arrow is pressed, MULTINPT
will be exited. TOFLD% will point to the field the
cursor would normally occupy via the down arrow being
pressed. This enables MULTINPT to be exited by an
auto-exit field and re-entered at the correct field.
If the field is a fixed choice field and the space bar
is pressed, TOFLD% will point to the fixed choice field
This is the field the cursor occupied before MULTINPT
was exited.
CODE$ specifies properties of the multi-field
input screen. CODE$ may equal the following.
"VIEW" ------ On entry MULTINPT will fill a single field
or all fields with their respective data.
MULTINPT is then exited. This is useful
for viewing a multi-field screen or
updating a single field ( see argument
AUTOEXIT% ).
"U" ---------- This changes the normal field to field
movement of the cursor when using the TAB,
SHIFT TAB, RIGHT ARROW, AND LEFT ARROW
keys to user defined order. User defined
order is the same order as fields are
defined in routine SETINPT. The TAB and
RIGHT ARROW keys follow user defined order
( same as ENTER or DOWN ARROW ). The SHIFT
TAB and LEFT ARROW keys follow reverse user
defined order ( same as UP ARROW ).
---------- All other string values for CODE$ have no
effect on the multi-field input screen.
AUTOEXIT% also serves two purposes.
1. If AUTOEXIT% is set to zero, MULTINPT, when entered,
will update all fields. If AUTOEXIT% is set from one
to the last field number only the specified field is
updated. This allows quick exiting from, and re-
entering of MULTINPT.
2. When MULTINPT is exited AUTOEXIT% will be set to zero
or an auto-exit field number ( the active field prior
to the exit ). It is important to distinguish this
from argument TOFLD% which points to the NEXT field the
cursor would normally occupy.
60
Copyright(c) 1988-92 - By: CONNECT Software - All rights reserved.
The following conditions will set AUTOEXIT% to zero on
exit.
- The field occupied by the cursor, on exit, was NOT an
auto-exit field.
- The field occupied by the cursor, on exit, was an
auto-exit, on change, field and the field's text was
not changed.
The following conditions will set AUTOEXIT% to an auto-
exit field number on exit.
- The field the cursor occupied, on exit, was an auto-
exit ( always ) field.
- The field the cursor occupied, on exit, was an auto-
exit ( on change ) field and the field's text was
changed.
- The field the cursor occupied, on exit, was a fixed
choice field. Fixed choice fields are ALWAYS auto-
exit fields. To determine if a fixed choice field
was exited via the space bar check argument RKEY% for
a value of 32.
Use AUTOEXIT% to determine if data entered in an auto-exit
field is valid or to use an auto-exit field's data as part
of a calculation.
RKEY% returns a value designation for the
key or feature which caused MULTINPT to be exited or auto-
exited. MULTINPT exits when a valid exit key (specified
in the call to SETINPT for the multi-field input screen)
is pressed. MULTINPT is auto-exited whenever the cursor
is moved out of an auto-exit ( always ) field, fixed
choice, or auto-exit ( on change ) field and the field's
text was changed. MULTINPT is also auto-exited when the
SPACE BAR is pressed with the cursor in a fixed choice
field. RKEY% may equal:
1 to 10 Exit keys, F1 to F10, caused MULTINPT to be
exited. MULTINPT was not exited by the auto-exit
feature although the field the cursor occupied on
exit may have been an auto-exit field.
11 ----- Exit key, PGUP, caused MULTINPT to be exited.
MULTINPT was not exited by the auto-exit feature
although the field the cursor occupied on exit
may have been an auto-exit field.
61
Copyright(c) 1988-92 - By: CONNECT Software - All rights reserved.
12 ----- Exit key, PGDN, caused MULTINPT to be exited.
MULTINPT was not exited by the auto-exit feature
although the field the cursor occupied on exit
may have been an auto-exit field.
13 ----- The RETURN key caused MULTINPT to be auto-exited.
The field must have been an auto-exit field.
14 ----- SHIFT TAB or the LEFT ARROW caused MULTINPT to be
auto-exited. The field must have been an
auto-exit field. IF ARGUMENT CODE$ = "U" ON ENTRY
TO MULTINPT THESE KEYS EXIT WITH RKEY% EQUAL TO
16.
15 ----- The TAB key or RIGHT ARROW caused MULTINPT to be
auto-exited. The field must have been an auto-
exit field. IF ARGUMENT CODE$ = "U" ON ENTRY TO
MULTINPT THESE KEYS EXIT WITH RKEY% EQUAL TO 13.
16 ----- The UP ARROW caused MULTINPT to be auto-exited.
The field must have been an auto-exit field.
17 ----- The CONTROL-HOME combination caused MULTINPT to
be auto-exited. The field must have been an
auto-exit field.
18 ----- The CONTROL-END combination caused MULTINPT to be
auto-exited. The field must have been an auto-
exit field.
19 ----- The DOWN ARROW caused MULTINPT to be auto-exited.
The field must have been an auto-exit field.
20 ----- The AUTO-ADVANCE feature caused MULTINPT to be
auto-exited. The field must also be an auto-exit
field. This occurs when the text fills a auto-
advance, auto-exit, field.
27 ----- Exit key, ESC, caused MULTINPT to be exited.
MULTINPT was not exited by the auto-exit feature
although field the cursor occupied on exit may
have been an auto-exit field.
32 ----- The SPACE BAR caused MULTINPT to be auto-exited.
The field occupied by the cursor on exit must have
been a fixed choice field which is always an auto-
exit field.
RTRN$() is a string array which holds the
data to be edited. Elements of RTRN$() will be
displayed in the appropriate fields. RTRN$(1) will be
displayed in field 1 and so on. Make sure there is not
62
Copyright(c) 1988-92 - By: CONNECT Software - All rights reserved.
a RTRN$(0) as it will not be displayed. If a field is
numeric, the number to be placed in it must be converted
to a string. Convert the number (A) to a string as
follows: RTRN$(2) = STR$(A)
When MULTINPT is exited RTRN$() holds the data in it's
edited state.
On entering MULTINPT, if the field is designated as
alpha/numeric and the string will not fit in the field
it will be truncated to fit. If the field is numeric
and a number formatted to the correct number of decimal
places will not fit in the field, "*"'s will be printed.
This will not pose a problem if RTRN$() is initialized
via MULTINPT, as MULTINPT will not allow the user to
input data longer than the field's width. If a numeric
field is entered with an alpha string the string will
print in the field. It is the programmer's responsibility
to assure numeric fields contain numeric strings. IF
A FIELD IS NUMERIC WITH 4 DECIMAL PLACES SETTING THE
FIELD TO EQUAL "DOG", WILL RESULT IN DOG.0000 BEING
DISPLAYED!
Use caution if a field is a result of calculation, as
the result may be in exponential format. EXAMPLE:
A = 1 B = 14 C = A/B
STR$(C) = "7.142857E-02". If the field is numeric with
four decimal places and set to equal STR$(C) it will
print as 7.1428, and not as .0714.
To following routine corrects numbers in expoential form
for both large and small numbers. A$ is the numeric
string to be displayed in a field.
IF INSTR(3, A$, "+") THEN A$ = "9999999999999999"
REM: THE NUMBER WAS TOO LARGE ( EX: 2.2D+22 ). SET TO
REM: "9999999999999999" AND "*"'s WILL BE DISPLAYED.
IF INSTR(3, A$, "-") THEN
A# = VAL(A$): A# = A# + SGN(A#): A$ = STR$(A#)
IF ABS(A#) > 1 THEN
A$ = MID$(A$, INSTR(A$, "."))
IF A# < 1 THEN A$ = "-" + A$
ELSE
A$="0"
END IF
END IF
REM: THE NUMBER WAS TOO SMALL. IF A$ = "3.33D-4",
REM: A$ WILL NOW = ".000333"
63
Copyright(c) 1988-92 - By: CONNECT Software - All rights reserved.
---------------------------------------------------------------
FIELD EDITING FEATURES FOR "MULTINPT" AND "INPTWIND"
( * = AVAILABLE FOR "MULTINPT" ONLY. )
---------------------------------------------------------------
KEY FUNCTION
SPACE BAR ERASES FIELD - IF IT IS THE FIRST KEY PRESSED.
*UP ARROW MOVES THE CURSOR FROM FIELD TO FIELD AS DETER-
*DOWN ARROW MINED BY THE ORDER DEFINED IN "SETINPT." THE
DOWN ARROW MOVES THE CURSOR IN ASCENDING FIELD
ORDER. THE UP ARROW MOVES IT IN DESCENDING
FIELD ORDER. PROTECTED FIELDS ARE SKIPPED.
*CTRL END MOVES THE CURSOR TO THE FIRST OR LAST FIELD AS
*CTRL HOME DESIGNATED BY THE ORDER DEFINED IN "SETINPT".
*TAB MOVES THE CURSOR FROM FIELD TO FIELD HORIZONT-
*SHIFT TAB ALLY. TAB MOVES LEFT TO RIGHT, SHIFT TAB MOVES
RIGHT TO LEFT. PROTECTED FIELDS ARE SKIPPED.
CTRL E ERASES THE FIELD.
ESC RETURNS A FIELD TO IT'S PRE-EDITED STATE OR
EXITS "MULTINPT". EXITS "INPTWIND" WITH PRE-
EDITED STRING. ESC EXITS "MULTINPT" IF THE
ESC KEY WAS DESIGNATED AS AND EXIT KEY BY
"SETINPT" ( FIELD NOT RESTORED TO PRE-EDITED
STATE ).
ENTER EXITS "INPTWIND". SAME AS DOWN ARROW FOR
RETURN "MULTINPT".
END MOVES THE CURSOR TO THE FIRST OR LAST POSITION
HOME OF TEXT WITHIN A FIELD.
BACKSPACE DELETES THE CHARACTER TO THE LEFT OF CURSOR.
DELETE DELETES THE CHARACTER UNDER THE CURSOR AND
SHIFTS CHARACTERS LEFT.
INSERT TOGGLES FROM INSERT TO OVERSTRIKE MODE. IF MODE
IS OVERSTRIKE THE CURSOR IS LARGE. INSERT MODE
IS THE DEFAULT EVERY TIME A FIELD IS ENTERED.
RIGHT ARROW MOVES THE CURSOR LEFT OR RIGHT. ACTS THE SAME
LEFT ARROW AS TAB OR SHIFT TAB FOR "MULTINPT" IF THE
CURSOR IN POSITION 1 AND THE LEFT ARROW IS
PRESSED, OR THE CURSOR IS AT THE END OF THE
TEXT AND THE RIGHT ARROW IS PRESSED.
64
Copyright(c) 1988-92 - By: CONNECT Software - All rights reserved.
***** DIRECTORY ROUTINES *****
Directory routines compliment features included with
QuickBASIC and BASIC 7.+ ( PDS ).. Procedures to find the
current disk, current path, disk capacity, and disk space
available are supplied with WINDOWS R-E-Z. Also included are
routines to find the directory of any disk or path. In
addition a file's size, date, time, and attributes can be
found.
6.00 GETDISK (DRIVE%)
Description: Retrieves the default disk drive.
Argument: DRIVE% is the current drive. DRIVE% = 1
for drive A:, 2 for B:, 3 for C:, 4 for D:, etc.
6.01 FINDPATH (PATH$)
NOTE: ALWAYS TRAP FOR DISK ERRORS PRIOR TO CALLING THIS
ROUTINE. SEE SECTION " MAKING A DIRECTORY SCROLL
WINDOW"
Description: Retrieves the current path ( directory ).
Argument: PATH$ is the path in the format:
DRIVE:\SUB-DIRECTORY\SUB-DIRECTORY....
PATH$ always starts with the drive letter.
6.02 SETDISK (DRIVE%, BADFLAG%)
Description: Changes the default drive.
Arguments: DRIVE% is the drive designation. DRIVE% =
1 for drive A:, 2 for B:, 3 for C:, etc.
BADFLAG% = 1 if DRIVE% is less than 1 or
greater than the number of logical drives. BADFLAG% = 0
if DRIVE% is in the range from 1 to the number of logical
drives in the system.
NOTE: A SYSTEM WITH A FLOPPY DRIVE FOR DRIVE A: AND A
HARD DISK FOR DRIVE C: HAS 3 LOGICAL DRIVES. THEREFORE,
BADFLAG% WILL = 0 IF DRIVE% = 1 TO 3 EVEN THOUGH A
PHYSICAL DRIVE B: DOES NOT EXIST. ATTEMPTS TO ACCESS
DRIVE B: MAY RESULT IN THE DOS MESSAGE. "Place a disk in
drive B: and press any key" BEING DISPLAYED.
65
Copyright(c) 1988-92 - By: CONNECT Software - All rights reserved.
6.03 DISKSIZE (DRIVE%, SIZE&, FREE&)
NOTE: ALWAYS TRAP FOR DISK ERRORS PRIOR TO CALLING THIS
ROUTINE. SEE SECTION " MAKING A SCROLL DIRECTORY
WINDOW".
Description: Retrieves disk space and disk free space.
Arguments: DRIVE% is the drive designation. It
follows the same rules as detailed in SETDISK. The note
for SETDISK applies.
SIZE& is the size in bytes of disk space.
FREE& is the size in bytes of free disk
space.
NOTE: THE ARGUMENTS FOR SIZE AND FREE SPACE ARE LONG
INTEGERS. ANY VARIABLE USED TO REPRESENT THEM MUST BE
DESIGNATED AS A LONG INTEGER ( FOLLOWED BY A "&" SIGN )
OR A PARAMETER MIS-MATCH WILL BE REPORTED.
6.04 FINDDIR (PATH$, TYP$, FILE%)
NOTE # 1: THE FOLLOWING MUST BE PLACED BEFORE ANY
EXECUTABLE STATEMENTS IN ANY MODULE CALLING "FINDDIR"
TYPE DIREC
SIZE AS LONG
DATE AS STRING * 10
TIME AS STRING * 6
ATTR AS INTEGER
END TYPE
COMMON SHARED /DIRECTORY/ DIREC$(), DIRINFO() AS DIREC
NOTE # 2: ALWAYS TRAP FOR DISK ERRORS PRIOR TO CALLING
THIS ROUTINE. SEE SECTION " MAKING A SCROLL DIRECTORY
WINDOW"
Description: Puts the directory listing of the
specified path in an array, DIREC$(). If a long
directory search is requested the files size, date, time
and attributes are also placed in array, DIRINFO(). The
arrays MUST be defined as explained above in NOTE # 1.
Arguments: PATH$ is the path for the directory
listing search. It must be in the same format as
returned by the procedure FINDPATH. It may be expanded
to restrict the search. Wildcards are permitted.
EXAMPLE: IF PATH$ = "C:\TEST\*.BAS", THE SEARCH WILL
66
Copyright(c) 1988-92 - By: CONNECT Software - All rights reserved.
FIND FILES IN DRIVE C:, SUB-DIRECTORY "TEST", WITH THE
EXTENSION ".BAS".
TYP$ restricts or expands the search to
include files with specified attributes. An "L" in TYP$
tells FINDDIR to make a long directory search. The
file's size, date, time and attributes are found in a
long directory search, in addition to the files name,
TYP$ may contain any combination of the following:
A - files archive bit set
H - hidden files
S - system files
R - read only files
D - sub-directory listings
V - volume entry
O - no file attribute
L - long directory search - SEE ABOVE
EXAMPLE: IF TYP$ = "HS" ONLY HIDDEN AND SYSTEM FILES
WILL BE FOUND.
FILE% is the number of files found. FILE% =
0 if no files were found.
If files are found their names are placed in the array,
DIREC$(). A long directory search places the file's
size, date, time and attribute designation in
DIRINFO().
DIREC$(1) = The name of first file found.
DIRINFO(1).SIZE = The size of the file.
DIRINFO(1).DATE = The files creation or last update date.
DIRINFO(1).TIME = The files creation or last update time.
DIRINFO(1).ATTR = The files attribute designation.
The following describes DIRINFO(1).ATTR;
IF DIRINFO(1).ATTR AND 1 the file is a read only file.
IF DIRINFO(1).ATTR AND 2 the file is a hidden file.
IF DIRINFO(1).ATTR AND 4 the file is a system file.
IF DIRINFO(1).ATTR AND 8 the entry is a volume entry.
IF DIRINFO(1).ATTR AND 16 the entry is a sub-directory.
IF DIRINFO(1).ATTR AND 32 the files archived bit is set.
IF DIRINFO(1).ATTR = 0 the file has no attribute.
NOTE: WHEN FINDDIR IS CALLED THE ARRAY, DIREC$() IS
AUTOMATICALLY DIMENSIONED TO THE NUMBER OF FILES FOUND.
THE ARRAY, DIRINFO() IS ALSO DIMENSIONED TO THE NUMBER
OF FILES FOUND PROVIDING THE DIRECTORY SEARCH IS A LONG
DIRECTORY SEARCH. EACH FILE FOUND USES ABOUT 16 BYTES
OF MEMORY PLUS AN ADDITIONAL 22 BYTES IF THE DIRECTORY
67
Copyright(c) 1988-92 - By: CONNECT Software - All rights reserved.
SEARCH IS LONG. TO RECLAIM THE MEMORY ( AFTER USING THE
INFORMATION RETURNED BY THE CALL TO FINDDIR ) THE ARRAYS
MUST BE ERASED VIA THE STATEMENT:
ERASE DIREC$, DIRINFO
68
Copyright(c) 1988-92 - By: CONNECT Software - All rights reserved.
***** MAKING A DIRECTORY SCROLL WINDOW *****
REM: THIS EXAMPLE FINDS THE DIRECTORY LISTING OF ALL FILES
REM: WITH THE ARCHIVE BIT SET IN DRIVE A. IT PUTS THE LISTING
REM: IN A SCROLL WINDOW AND WAITS FOR THE SELECTION OF A
REM: FILE.
TYPE DIREC ' REQUIRED IN ANY MODULE
SIZE AS LONG ' USING DIRECTORY ROUTINES.
DATE AS STRING * 10
TIME AS STRING * 6
ATTR AS INTEGER
END TYPE
COMMON SHARED /DIRECTORY/ DIREC$(), DIRINFO() AS DIREC
DIM DUMMY$ (0) ' FOR INFO-LINE (NOT USED)
CALL SETWIND(1, 1, 7 ) ' INITIALIZE
START:
CLS
ON ERROR GOTO DISKERROR ' ALWAYS TRAP FOR DISK
' ERRORS.
REM: AS TYP$ INCLUDES AN "A", THE FOLLOWING CALL TO
REM: FINDDIR PLACES FILES WITH THE ARCHIVE BIT SET FROM
REM: DRIVE A:, ("A:\"), IN DIREC$(). AS TYP$ INCLUDES AN "L"
REM: THE FILES SIZE, DATE, TIME AND ATTRIBUTES ARE PLACED IN
REM: DIRINFO(). FILE% HOLDS THE NUMBER OF FILES FOUND.
TYP$ ="AL"
CALL FINDDIR ("A:\", TYP$, FILE%)
IF FILE% > 0 THEN ' ONLY IF FILES EXISTED.
REM: MAKE A WINDOW. STATEMENT MUST BE ON 1 LINE
CALL MAKEWIND(1 ,"@Select file - Press ENTER",
100 ,100 ,30 ,10 ,15 ,101)
REM: MAKE IT AN AUTO-EXIT SCROLL WINDOW.
KIND$ ="A" ' AUTO-EXIT FEATURE IS ON.
' Following must be on one line.
CALL SCRLWIND(DIREC$(), DUMMY$(),"", FILE%, KIND$,
RTRN%, 1, 1, RKEY%, 0)
IF RKEY%% <> 27 THEN
LOCATE 1,1
PRINT "FILE .......";DIREC$(RTRN%)
PRINT "SIZE........";DIRINFO(RTRN%).SIZE
PRINT "DATE........";DIRINFO(RTRN%).DATE
PRINT "TIME........";DIRINFO(RTRN%).TIME
PRINT "ATTRIBUTE...";DIRINFO(RTRN%).ATTR
69
Copyright(c) 1988-92 - By: CONNECT Software - All rights reserved.
ERASE DIREC$, DIRINFO
END IF
CALL RSTRWIND(1,1) ' REMOVE THE WINDOW
IF RTRN%= 0 THEN GOTO START 'ESC WAS PRESSED
ELSE ' FILE% = 0 ( NO FILES WERE FOUND )
PRINT "NO FILES WERE FOUND"
END IF
ON ERROR GOTO 0 ' TURN OFF ERROR DETECTION
END
DISKERROR:
REM: ERR = ERROR NUMBER. THIS ERROR HANDLING ROUTINE
REM: WILL DETECT IF DISK IS NOT READY, NOT AVAILABLE,
REM: OR PATH WAS BAD.
SELECT CASE ERR
CASE 71
E$ = "DISK NOT READY"
CASE 68
E$ = "DISK NOT AVAILABLE"
CASE 76
E$ = "PATH NOT FOUND"
CASE ELSE
E$ = "UN-IDENTIFIED DISK ERROR"
END SELECT
REM: FOLLOWING MUST BE ON ONE LINE
CALL GETANS("DISK ERROR: " + E$ + " Press any key.."
,"", "",100 ,100, 143, 1)
RESUME START
70
Copyright(c) 1988-92 - By: CONNECT Software - All rights reserved.
**** KEYBOARD AND MOUSE ROUTINES ****
Adding the ability to "read the mouse" these routines provide
increased flexibility over BASIC's INKEY$ statement.
NOTE: THESE ARE ASSEMBLY ROUTINES. ALWAYS PLACE THEM IN
DECLARE STATEMENTS IN ANY MODULE WHICH USES THEM. THIS
WILL ASSURE ARGUMENT MATCHING AND PREVENT ACCIDENTAL
PROGRAM "CRASHES".
7.00 KEYMOUSE%
Description: KEYMOUSE% is a function. It pauses program
execution. Upon keyboard or mouse input the program
resumes with the appropriate code returned in KEYMOUSE%.
The mouse buttons are user definable via the procedure
MBUTTONS. Mouse movement emulates the arrow keys. Up,
down, left, and right mouse movement places the same
value in KEYMOUSE% as the corresponding arrow key. If
the key or mouse button pressed produces a standard
ASCII/IBM character, the code for the character ( 1 to
255 ) is returned in KEYMOUSE%. If the key pressed, or
mouse movement, produces an extended scan code such as
the up arrow, the extended scan code for the key
multiplied by 256 is returned in KEYMOUSE%. KEYMOUSE%
returns 18432 ( 72 * 256 ) for the up arrow. For those
keys which produce an extended scan code over 127, such
as CTRL-PGUP ( 129 ), KEYMOUSE% returns a negative
value. SEE THE KEYMOUSE CODE CHART IN THE APPENDIX.
-------------------------------------------------------
'EXAMPLE: WAITS FOR RETURN, "A", DOWN ARROW, OR END.
'PRESS END TO END
DECLARE FUNCTION KEYMOUSE%
INPT:
A% = KEYMOUSE% ' PROGRAM WAITS FOR INPUT HERE
SELECT CASE A%
CASE 13 ' 13 IS ASCII FOR THE RETURN KEY
PRINT "RETURN"
CASE 65 ' 65 IS ASCII FOR "A"
PRINT "A"
CASE 80 * 256 ' 80 IS THE EXTENDED SCAN
PRINT "DOWN ARROW" ' CODE FOR THE DOWN ARROW.
CASE 79 * 256 ' 79 IS THE EXTENDED SCAN
PRINT "END" ' FOR END.
END
CASE ELSE
GOTO INPT
END SELECT
GOTO INPT
--------------------------------------------------------
71
Copyright(c) 1988-92 - By: CONNECT Software - All rights reserved.
7.01 MBUTTONS% ( LBUTTON%, RBUTTON%)
NOTE: THIS ROUTINE MUST BE CALLED AT LEAST ONCE IN ANY
PROGRAM BEFORE ATTEMPTING TO USE THE MOUSE.
Description: Sets the values which will be placed in
function KEYMOUSE% for the left and right mouse buttons.
Arguments: LBUTTON% sets the value which will be
returned in function KEYMOUSE% when the left mouse button
is pressed. It may range from 0 to 255. If LBUTTON% is
greater than 255 it is converted to LBUTTON% AND 255
RBUTTON% sets the value which will be
returned in function KEYMOUSE% when the right mouse
button is pressed. It may range from 0 to 255. If
RBUTTON% is greater than 255 it is converted to
LBUTTON% and 255.
--------------------------------------------------------
' EXAMPLE: SETS THE LEFT MOUSE BUTTON TO "RETURN" AND
' THE RIGHT MOUSE BUTTON TO "ESC". 13 IS THE ASCII CODE
' FOR "RETURN". 27 IS THE ASCII CODE FOR "ESC".
DECLARE SUB MBUTTONS ( LBUTTON%, RBUTTON% )
CALL MBUTTON ( 13, 27 )
--------------------------------------------------------
7.02 MOUSEON (ISON%)
NOTE: THIS ROUTINE MUST BE CALLED AT LEAST ONCE IN ANY
PROGRAM BEFORE ATTEMPTING TO USE THE MOUSE.
Description: Sets the mouse status.
Arguments: ISON% sets the mouse status as follows:
If ISON% = 0 the mouse is off.
If ISON% = 1 the mouse is on.
If ISON% = 2 the mouse buttons remain active
but mouse movement detection is disabled.
Any other value for ISON% sets the mouse to on.
-------------------------------------------------------------
9.00 DOSOUND
Description: Makes the default sound ,or sound as
specified by a previous call to SETWIND.
Arguments: None.
72
Copyright(c) 1988-92 - By: CONNECT Software - All rights reserved.
**** INFO-LINE ROUTINES *****
These routines allow the programmer to set up and print in an
info-line at any location on the screen. The info-line can be
used to print messages, instructions, or a prompt. Used in
conjunction with routines PULLDOWN and SCRLWIND these routines
will change the message in the info-line as the scroll bar is
moved through the selections in the pulldown and scroll windows.
10.00 INFOLINE ( TR%, LC%, WD%, ATTR% )
Description: Set up routine for routines PRINTINFO,
INFOFIXED, AND RSTRINFO. Sets the coordinates and the
color for the info-line. Defines the fixed info-string to
equal "" ( SEE: INFOFIXED ). Makes the info-line active.
Saves the display area specified by TR%, LC%, and WD%.
This area may be restored by calling routine RSTRINFO.
INFOLINE DOES NOT PRINT OR DISPLAY THE INFO-LINE. THIS IS
ACCOMPLISHED BY ROUTINE PRINTINFO. Routine PRINTINFO is
incorporated in routines PULLDOWN and SCRLWIND. It may
also be used prior to calling other routines. ( SEE:
Examples - Info-line routines )
NOTE: IF AN INFO-LINE IS ACTIVE A CALL TO INFOLINE DOES
NOTHING EXCEPT TO CHANGE THE COLOR (IF IT IS DIFFERENT) OF
THE INFO-LINE FOR SUBSEQUENT CALLS TO PRINTINFO. THE
INFO-LINE IS DEACTIVATED VIA A CALL TO RSTRINFO.
Arguments: TR% is the top row position of the info-line.
It must range from 1 to 25 or an error will be reported.
LC% is the left column position of the info-
line. If LC% + WD% > 81 an error will be reported.
WD% is the info-lines width. If WD% + LC% >
81 an error will be reported.
ATTR% is the info-lines color ( SEE THE COLOR
ATTRIBUTE CHART ). ATTR% must range from 1 to 255 or it
is adjusted to ATTR% AND 127.
10.01 PRINTINFO ( INFO$ )
Description: Displays the info-line and prints in same.
The info-line must be made active by a previous call to
INFOLINE. If a fixed info-string has been previously
defined by a call to routine INFOFIXED, PRINTINFO adds
it's text to the fixed info-string and displays the result
in the info-line ( SEE: INFOFIXED ). If an info-line is
not active PRINTINFO does nothing. ( SEE: Examples -
Info-line routines.
73
Copyright(c) 1988-92 - By: CONNECT Software - All rights reserved.
Argument: INFO$ is the string which will print in the
info-line. If a fixed info-string has been defined by
routine INFOFIXED, INFO$ is added to the fixed info-string
with the result printing in the info-line. If the length
of the fixed info-string plus the length of INFO$ will not
fit in info-line defined by routine INFOLINE it is
truncated to fit.
10.02 INFOFIXED ( FIXEDINFO$ )
Description: Defines a fixed info-string which will print
every time routine PRINTINFO is called. As PRINTINFO is
called for every entry in a scroll or pulldown window,
INFOFIXED is useful for these routines. The info-line
must be active or INFOFIXED does nothing.
( SEE: Examples - Info-line routines )
Argument: FIXEDINFO$ is the fixed info-string. It will
remain the fixed info-string until routine RSRTINFO is
called with argument DELFLAG% = 1 ( SEE: RSTRINFO ). The
fixed info-string may be temporarily disabled by calling
INFOFIXED with FIXEDINFO$ equal to "".
10.03 RSTRINFO ( DELFLAG% )
Description: Restores the display area under the info-
line. This area was saved by a previous call to INFOLINE.
If the info-line is not active RSTRINFO does nothing.
(SEE: Examples - Info-line routines. )
Argument: DELFLAG% is set to 1 to deactivate the info-
line. If DELFLAG% = 1 the display area saved by routine
INFOLINE is restored to the display. An info-line will no
longer be active. If DELFLAG% = 0 the info-line remains
active. The saved display area is restored. The saved
display are remains in window memory, however.
NOTE: THE SAVED DISPLAY AREA RESIDES IN WINDOW NUMBER 25.
FUNCTION WAVAIL% CAN DETERMINE IF THE INFOLINE IS ACTIVE.
EXAMPLE: IF WAVAIL%(25) = 0 ' The info-line is active.
IF WAVAIL%(25) = 1 ' the info-line is not active.
74
Copyright(c) 1988-92 - By: CONNECT Software - All rights reserved.
-----------------------------------------------------------------
' Example: Info-line routines
' THIS EXAMPLE WILL NOT RUN AS THE CALLS TO INPTWIND, SCRLWIND,
' AND PULLDOWN ARE NOT COMPLETE.
' INFO-LINE TOP ROW = 25
' INFO-LINE LEFT COLUMN = 1
' INFO-LINE WIDTH = 80
' INFO-LINE COLOR = BLACK ON GRAY
' SAVES DISPLAY AREA ( ALL OF ROW 25 AS WIDTH = 80 )
CALL INFOLINE ( 25, 1, 80, 112 ) ' INFO-LINE MADE ACTIVE
CALL PRINTINFO ( "INPUT YOUR NAME" ) ' PRINT IN INFO-LINE
CALL INPTWIND....... ' TO INPUT A NAME
CALL RSTRINFO ( 0 ) ' DISPLAY AREA UNDER INFO-LINE IS
' RESTORED TO DISPLAY. INFO-LINE
' REMAINS ACTIVE.
' **** USE SAME INFO-LINE FOR A SCROLL WINDOW. IN THIS EXAMPLE
' **** THE INFO-LINE DISPLAYS THE SAME MESSAGE FOR ALL ENTRIES IN
' **** THE SCROLL WINDOW.
CALL INFOFIXED ( "MAKE A SELECTION" )
DIM INFO$(0) ' MUST BE DIMENSIONED TO 0 TO DISPLAY
' THE FIXED INFO-STRING ONLY.
CALL SCRLWIND ( LIST$(), INFO$(), ..... ' MAKE SCROLL WINDOW
' "MAKE A SELECTION" IS PRINTED IN INFO-LINE FOR ALL ENTRIES IN
' THE SCROLL WINDOW. ROUTINE SCRLWIND INTERNALLY CALLS ROUTINE
' PRINTINFO TO PRINT IN THE INFO-LINE.
CALL RSTRINFO ( 0 ) ' DISPLAY AREA UNDER INFO-LINE IS
' RESTORED TO DISPLAY. INFO-LINE
' REMAINS ACTIVE.
CALL INFOFIXED ( "" ) ' REMOVE FIXED INFO-STRING.
' **** USE SAME INFO-LINE FOR A SCROLL WINDOW. PRINT A DIFFERENT
' **** MESSAGE FOR EACH ITEM IN THE SCROLL WINDOW.
CALL INFOFIXED ( "Directions: " ) ' Set fixed info-string
DIM INFO$(3) ' The fixed info-string plus
INFO$(1) = "Save a file." ' these elements of INFO$() will
INFO$(2) = "Load a file." ' print for the corresponding
INFO$(4) = "Delete a file." ' entries in the scroll window.
75
Copyright(c) 1988-92 - By: CONNECT Software - All rights reserved.
CALL SCRLWIND ( LIST$(), INFO$()..........
' ** The following will print in the info-line.
' "Directions: Save a file." prints for scroll window entry 1.
' "Directions: Load a file." prints for scroll window entry 2.
' "Directions: Save a file." prints for scroll window entry 3.
CALL RSTRINFO ( 0 ) ' DISPLAY AREA UNDER INFO-LINE IS
' RESTORED TO DISPLAY. INFO-LINE
' REMAINS ACTIVE.
' **** USE THE SAME INFO-LINE FOR PULLDOWN WINDOWS. THE FIXED
' **** INFO-STRING STILL EQUALS "Directions".
DIM INFO$(20) ' The fixed info-string plus
INFO$(1) = "Save a file." ' these elements of INFO$() will
INFO$(2) = "Load a file." ' print for the corresponding
INFO$(3) = "Delete a file." ' entries in the scroll window.
'... DO UP TO THE 20TH ELEMENT OF INFO$
'...
' NOTE: INFO$() MUST BE DIMENSIONED TO ZERO ( DIM INFO$(0) ). IF
' THE INFO-LINE IS NOT TO BE USED. THE TEXT FOR THE INFO-LINE FOR
' THE MENUBAR ITEMS IS SET BY ROUTINE SETPULL. INFO$() ONLY SETS
' THE TEXT FOR THE INFO-LINE FOR THE SELECTIONS IN THE PULLDOWN
' WINDOWS.
CALL PULLDOWN ( INFO$()......
' ** The following will print in the info-line.
' "Directions: Save a file." for pulldown window entry 1.
' "Directions: Load a file." for pulldown window entry 2.
' "Directions: Save a file." for pulldown window entry 3.
CALL RSTRINFO ( 0 ) ' DISPLAY AREA UNDER INFO-LINE IS
' RESTORED TO DISPLAY. INFO-LINE
' REMAINS ACTIVE.
'*** USE SAME INFO-LINE WITH ROUTINE GETANS. PROMPT IS PRINTED IN
'*** INFO-LINE BY PRINTINFO. GETANS DOES NOT PRINT A PROMPT. IT
'*** ONLY WAITS FOR A REPLY.
CALL PRINTINFO ( "(Y)es or (N)o ?" ) ' PROMPT USER FOR "Y" OR "N".
CALL GETANS ("", "YN", ANS$, 100, 100, 112, 0 )
' GETANS COORDINATES ARE MEANINGLESS AS A PROMPT IS NOT PRINTED.
' COORDINATES MUST STILL BE WITHIN VALID RANGES. THE BORDER
' DESIGNATION MUST BE SET TO ZERO OR GETANS WILL GENERATE A
' WINDOW.
76
Copyright(c) 1988-92 - By: CONNECT Software - All rights reserved.
CALL RSTRINFO ( 1 ) ' DISPLAY AREA UNDER INFO-LINE RESTORED
' TO DISPLAY.
' *** AS ARGUMENT = 1 THE INFO-LINE IS
' NO LONGER ACTIVE. INFOLINE MUST BE
' CALLED AGAIN TO MAKE IT ACTIVE.
77
Copyright(c) 1988-92 - By: CONNECT Software - All rights reserved.
PROGRAM FORMAT FOR WINDOWS R-E-Z
** NOTE: ALL NUMERIC VALUES MUST BE INTEGERS FOR ALL **
PROCEDURES EXCEPT DISKSIZE. ( EX: A%, B%, DEFINT A-F )
1. LOAD QUICKBASIC WITH CORRECT LIBRARY.
- UNENHANCED VERSION:
EX: QB/L QB4UNEN.QLB ( QB 4.00, 4.00b, 4.50 )
QBX/L PDSUNEN.QLB ( BASIC 7.0, 7.1 - PDS )
- ENHANCED VERSION:
EX: QB/L QB4ALL.QLB ( QB 4.00, 4.00b, 4.50 )
QBX/L PDSALL70.QLB ( BASIC 7.0 - PDS )
QBX/L PDSALL71.QLB ( BASIC 7.1 - PDS )
2. DECLARE ALL SUB-ROUTINES AND FUNCTIONS.
REM $INCLUDE: 'DECLARE.INC'
' 3. CALL SETWIND TO INITIALIZE WINDOW MEMORY, INPTINIT TO
' INITIALIZE INPUT ROUTINES. TURN THE MOUSE ON AND SET
' MOUSE KEYS.
CLS
CALL SETWIND(1, 1, 7 ) 'FAST WINDOWS
'SOUND DEFAULTS TO "CLICK"
'SHADOW COLOR = GRAY
CALL INPTINIT ( 1, 1, "") 'DATE = MM-DD-YYYY
'PERIOD AS DECIMAL POINT
'ESC & ENTER EXIT INPTWIND
CALL MOUSEON (1) 'MOUSE IS ON
CALL MBUTTONS (13,27) 'LEFT BUTTON = ENTER
'RIGHT BUTTON = ESC
' 4. CALL SETPULL IF PULLDOWN WINDOWS ARE USED
A%= 25
DIM PWIND$(A%) ' SET TEMPORARY
' ARRAY
DIM PULLINFOLINE$(0) ' INFO-LINE NOT USED
TEMP%=0
WHILE PWIND$(TEMP%) <> "ENDPULL"
TEMP% = TEMP% + 1 ' ALWAYS START AT 1
READ PWIND$(TEMP%) ' READ DATA FOR
WEND ' PULLDOWN WINDOWS.
CALL SETPULL (1, 1, 80, PWIND$()) ' CALL SETPULL
ERASE PWIND$ ' AND ERASE ARRAY
78
Copyright(c) 1988-92 - By: CONNECT Software - All rights reserved.
' PULLDOWN WINDOW DATA
DATA THIS,,HELLO,JOE,***
DATA IS,,HOW,ARE,YOU,***
DATA A,,I,AM,FINE,***
DATA SAMPLE,,BYE,***
DATA ENDPULL
ON KEY(1) GOSUB PULL ' MAKE THE F1 KEY
' THE "HOT" KEY FOR
' PULLDOWN WINDOWS
'5. READ DATA FOR SCROLL WINDOW(S)
DIM LIST$(10) ' DIMENSION ARRAY
FOR X%= 1 TO 10 ' AND READ SCROLL
READ LIST$(X%) ' WINDOW DATA
NEXT
DATA ONE, TWO, THREE, FOUR, FIVE ' DATA FOR A SCROLL
DATA SIX, SEVEN, EIGHT, NINE, TEN ' WINDOW
'6. READ DATA FOR MULTI-FIELD INPUT SCREEN(S)
A%=20
B%=3
DIM INPT%(A%),INPT$(B%) ' TEMPORARY ARRAYS
TEMP% = 1 ' ALWAYS START AT 1
FLD%=1
DO
READ INPT%(TEMP%) ' READ CODE%.
' IF CODE%=9999 DONE.
IF INPT%(TEMP%)=9999 THEN EXIT DO
TEMP%=TEMP%+1
FOR X%=1 TO 5 ' READ REMAINING 5
READ INPT%(TEMP%) ' NUMERIC VALUES IN
' INPT%().
TEMP% = TEMP% + 1
NEXT
READ INPT$(FLD%) ' READ FIELD DATA IN
FLD%=FLD%+1 ' INPT$() - RESTRICT
LOOP ' DATA.
' MULTI- FIELD INPUT DATA
DATA 0,1,1,15,7,99,""
DATA 11007,3,1,40,7,99,""
DATA 108,5,1,10,32,99,""
DATA 9999
CALL SETINPT( 1, 80, "12", INPT%(), INPT$(),0 ) ' SET INPUT
' SCREEN.
79
Copyright(c) 1988-92 - By: CONNECT Software - All rights reserved.
ERASE INPT%,INPT$ ' GET THE MEMORY BACK
'7. ENTER THE PROGRAM
MAIN:
LOCATE 25, 1 :PRINT "PRESS F1"
KEY (1) ON ' TURN ON "HOT" KEY AT
' . ' APPROPRIATE SPOT IN
' . ' PROGRAM.
' . ' WAIT FOR F1 KEY.
GOTO MAIN
REM PULL IS A SUB ROUTINE WHICH IS ENTERED VIA THE
REM F1 KEY BEING PRESSED. THIS SUB DISPLAYS THE
REM PULLDOWN WINDOW AND WAITS FOR AN ITEM TO BE
REM SELECTED FROM SAME. IF THE ESC KEY IS PRESSED
REM THE PROGRAM RESUMES EXECUTION WHERE IT WAS
REM INTERRUPTED BY THE F1 KEY. IF AN ITEM IS
REM SELECTED A ROUTINE IS EXECUTED. AFTER EXECUT-
REM ION THE PROGRAM CONTINUES AT MAIN.
REM THIS IS A SUGGESTION FOR A METHOD TO USE PULL-
REM DOWN WINDOWS. ALTERNATE METHODS MAY BE USED,
REM SUCH AS CALL "PULLDOWN" AT START OF PROGRAM.
REM AND NOT USING A HOT KEY.
PULL:
KEY (1) OFF
REM: MUST BE ON ONE LINE IN QB, QBX EDITOR.
CALL PULLDOWN (PULLINFOLINE$(), MENUITEM% , WINDITEM%, "E",
RKEY%, 112, 15, 11)
CALL RSTRPULL (1) ' RESTORE AREA UNDER
' PULLDOWN WINDOW.
SELECT CASE MENUITEM%
CASE 1 ' MENUBAR ITEM = THIS
SELECT CASE WINDITEM%
CASE 1 ' HELLO
' . ' ROUTINE FOR HELLO
' .
CASE 2 ' JOE
' . ' ROUTINE FOR JOE
' .
END SELECT
CASE 2 ' MENUBAR ITEM = IS
SELECT CASE WINDITEM%
CASE 1 ' HOW
' . ' ROUTINE FOR HOW
' .
CASE 2 ' ARE
' . ' ROUTINE FOR ARE
80
Copyright(c) 1988-92 - By: CONNECT Software - All rights reserved.
' .
CASE 3 ' YOU
' . ' ROUTINE FOR YOU
' .
END SELECT
CASE 3 ' MENUBAR ITEM = A
SELECT CASE WINDITEM%
CASE 1 ' I
' . ' ROUTINE FOR I
' .
CASE 2 ' AM
' . ' ROUTINE FOR AM
' .
CASE 3 ' FINE
' . ' ROUTINE FOR FINE
' .
END SELECT
CASE 4 ' MENUBAR ITEM = SAMPLE
' . ' ROUTINE FOR SAMPLE
' . ' ( OR BYE )
CASE ELSE
END ' WAS ESC
END SELECT
KEY (1) ON
RETURN MAIN ' DONE WITH THE ROUTINE
' SELECTED FROM
' PULLDOWN WINDOWS
81
Copyright(c) 1988-92 - By: CONNECT Software - All rights reserved.
MAKING A CUSTOMIZED LIBRARY
( Enhanced version only )
Users familiar with LINK and LIB utilities may prefer to
create libraries outside of QuickBASIC'S environment using
the appropriate object files. As individual assembly object
files can be linked together to create smaller libraries
this is the preferable method. See the section "FILES" for
a description of all files.
The libraries ( QB4ALL.QLB, PDSALL70.QLB, PDSALL71.QLB,
QB4ALL.LIB, PDSALL70.LIB and PDSALL71.LIB ) are complete and
contain all of the procedures in WINDOWS R-E-Z. If all of
the procedures are not required in your program customized
libraries using less memory may be made in the QuickBASIC
environment as follows:
For QB 4.00 and 4.00b:
1. Load QuickBASIC using the command QB/L QB4ASM. The file,
QB4ASM.QLB, contains the assembly routines required by
all of the other procedures.
2. Load the modules WIND_REZ.BAS and QB4MEM.BAS. ALL
PROCEDURES EXCEPT THOSE IN DIRWIND.BAS REQUIRE THESE
MODULES. They contain the basic windowing routines. If
this is all your program requires select the Make library
option from the Run menu in QuickBASIC (see your manual)
to make the library. ( QB4ASM.LIB must be present.)
3. Load any other modules your program requires. IF YOU
WANT TO USE PULLDOWN WINDOWS THE MODULES PULLDOWN.BAS
AND SCROLL.BAS MUST BOTH BE LOADED. All other
modules may be loaded independent of each other.
When all of the modules you will be using are loaded
make the library as in step 2.
Two libraries will be produced. The library with the suffix
.QLB is used in the QuickBASIC environment and the library
with the suffix .LIB must be available to produce an
executable file. To use your new library ( assuming a name
of NEWLIB.QLB ) exit QuickBASIC and reload with the command
QB/L NEWLIB.
For QuickBASIC version 4.50 and BASIC 7.+ ( PDS );
Versions 4.5 of QuickBasic and BASIC 7.0+ ( PDS ) do not use
the "full library" mode while linking. Therefore it is not
necessary to build a customized library or link outside of
the QuickBASIC environment to produce the smallest possible
executable programs.
82
Copyright(c) 1988-92 - By: CONNECT Software - All rights reserved.
FILES
The following files are included with WINDOWS R-E-Z.
Files starting with "QB4" are for use with QB 4.00, QB 4.00b
and QB 4.50. These files are not included with WINDOWS R-E-Z
for BASIC 7.+ ( PDS ). Files starting with "PDS" are for
use with BASIC 7.+, ( PDS ) These files are not included
with WINDOWS R-E-Z for QB 4.+.
Library Files:
- Library consisting of all assembly procedures.
* QB4ASM.LIB -- For QuickBASIC 4.+
* PDSASM.LIB -- For BASIC 7.+
- QuickBASIC version of QB4ASM.LIB or PDSASM.LIB
* QB4ASM.QLB -- For QuickBASIC 4.+
* PDSASM.QLB -- For BASIC 7.+
- Library consisting of all assembly and BASIC procedures.
* QBALL45.LIB -- For QuickBASIC 4.50
* QBALL40.LIB -- For QuickBASIC 4.00/4.00b
* PDSALL70.LIB - For Basic 7.0
* PDSALL71.LIB - For Basic 7.1
** QB4UNEN.LIB -- For QuickBASIC 4.+ ( unenhanced )
** PDSUNEN.LIB -- For BASIC 7.+ ( unenhanced )
- QuickBASIC version of QB4ALL.LIB, PDSALL70.QLB or
PDSALL71.QLB.
* QBALL45.QLB -- For QuickBASIC 4.50
* QBALL40.QLB -- For QuickBASIC 4.00/4.00b
* PDSALL70.QLB - For BASIC 7.0
* PDSALL71.QLB - For BASIC 7.1
** QB4UNEN.QLB -- For QuickBASIC 4.+ ( unenhanced )
** PDSUNEN.QLB -- For BASIC 7.+ ( unenhanced )
- Library of all assembly and BASIC procedures without
error detection or window status. Program MUST be
completely "debugged" before these are used.
* QBNER45.LIB -- For QuickBASIC 4.50
* QBNER40.LIB -- For QuickBASIC 4.00/4.00b
* PDSNER70.LIB - For BASIC 7.0
* PDSNER71.LIB - For BASIC 7.1
* Not included with the unenhanced version of WINDOWS R-E-Z.
** Not included with the enhanced version of WINDOWS R-E-Z.
83
Copyright(c) 1988-92 - By: CONNECT Software - All rights reserved.
- QuickBASIC version of QB4NER.LIB, PDSNER70.LIB or
PDSNER71.LIB.
* QBNER45.QLB -- For QuickBASIC 4.50
* QBNER40.QLB -- For QuickBASIC 4.00/4.00B
* PDSNER70.QLB - For BASIC 7.0
* PDSNER71.QLB - For BASIC 7.1
Object Files:
* QB4WIND.OBJ -- Object file of assembly windowing
* PDSWIND.OBJ routines.
* QB4INPT.OBJ -- Object file of assembly input routines.
* PDSINPT.OBJ " "
* QB4DIR.OBJ --- Object file of assembly directory
* PDSDIR.OBJ routines.
* QB4SCRL.OBJ -- Object file of assembly scroll
* PDSSCRL.OBL routines
* PDSMEM70.OBJ - Alternate memory management module.
* PDSMEM71.OBJ - " "
Basic Files:
* INPTWIND.BAS - BASIC source code for routines in
* PULLDOWN.BAS WINDOWS R-E-Z.
* SCROLL.BAS "
* WIND_REZ.BAS "
* DIRWIND.BAS "
* QB4MEM.BAS ( QuickBASIC 4.+ )
* PDSMEM.BAS ( BASIC 7.+ )
Demonstration files.
DEMO.BAS ----- Source code for demonstration program.
DEMPART2.BAS - Source code ( part 2 ) demonstration.
MULTSAM1.BAS Sample multi-field input program
MULTSAM2.BAS "
MULTSAM3.BAS "
SCRLRAND.BAS Scroll through a random acess file.
RANDDATA.DAT Sample random access database.
SCRLISAM.BAS Scroll through an ISAM table.
ISAMDATA.DAT Sample ISAM data file.
NOTE: All BASIC files except QB4MEM.BAS and PDSMEM.BAS are
the same for QuickBASIC 4.+ and BASIC 7.0/7.1. All basic
routines require the presence of the module WIND_REZ.BAS.
* Not included with the unenhanced version of WINDOWS R-E-Z.
** Not included with the enhanced version of WINDOWS R-E-Z.
84
Copyright(c) 1988-92 - By: CONNECT Software - All rights reserved.
Other Files:
** WIND_REZ.DOC - This document.
* WIND_REZ.EXE - Self-extracting compressed documentation.
Un-compresses to WIND_REZ.DOC.
SCRLFILE.DOC - Scroll through file documentation.
DEMO.EXE ----- Demonstration program.
PRNTDOT.BAT -- Batch file for printing WIND_REZ.DOC.
PRNTLAS.BAT -- Batch file for printing WIND_REZ.DOC on a
HP compatible laser printer.
DECLARE.INC -- INCLUDE file containing DECLARE
statements for all routines.
ORDER.ME ----- Order form for WINDOWS R-E-Z.
READ.ME ----- Update information.
* QUICKREF.DOC - Quick reference guide.
* PRNTDOT2.BAT - Batch file for printing QUICKREF.DOC.
* PRNTLAS2.BAT - Batch file for printing QUICKREF.DOC on a
HP compatible laser printer.
* Not included with the unenhanced version of WINDOWS R-E-Z.
** Not included with the enhanced version of WINDOWS R-E-Z.
85
Copyright(c) 1988-92 - By: CONNECT Software - All rights reserved.
Errors
The following is a listing of the errors WINDOWS R-E-Z
will detect.
ERROR # DESCRIPTION
------------------------------------------------------------
ERROR 0 There is no active window. SCRLWIND, RESAVE
CLRWIND, PRINTW, LINEW, and NEWCOLOR require
an active window.
ERROR 1 SETWIND has not been called to initialize
window memory. This error will also be reported
if the program uses a CLEAR statement and SETWIND
has not be called to re-initialize window
memory.
ERROR 2 A window number has been specified which is
out of range for the calling routine. Window
number 20 is the maximum window number for all
routines. Window number 1 is the minimum
window number for SAVEWIND, DELWIND, and
RSTRWIND. Window number 0 is the minimum
window number for MAKEWIND and CHNGWIND.
ERROR 3 The shadow, specified in a call to MAKEWIND,
will not fit on the screen. If this error is
displayed the window will fit on the screen
but the shadow will not.
ERROR 4 The window will not fit on the screen or the
window is too small. The left column plus the
window's width makes the window too wide or the
top row plus the number of rows makes the
window too tall. The left column and top row
must be greater than 0. The width and number
of rows must be greater than 2. GETANS makes a
window with a width predicated on the width of
the prompt. INPTWIND makes a window with a
width based on the length of the prompt plus
the width of the input field. PULLDOWN windows
have a width based on the longest item in the
pulldown window's list. This error is reported
for INPTWIND and GETANS if no window is
specified ( BORDER%=0 ) and the width of the
prompt and/or field will not fit on the screen.
86
Copyright(c) 1988-92 - By: CONNECT Software - All rights reserved.
ERROR 5 The border designation is not valid for the
calling routine. GETANS does not allow title
windows. PULLDOWN does not allow title
windows and only allows right-bottom shadows.
SEE THE BORDER DESIGNATION CHART.
ERROR 6 A request was made to CHNGWIND to make the
active window a non-existent window or a
window saved via SAVEWIND. The active window
can only be a window generated by MAKEWIND.
ERROR 7 A call was made to RESAVE when the active
window was window number 0. RESAVE can only
resave active window 1 to 20.
ERROR 8 An window specified in a call to MAKEWIND or
SAVEWIND previously existed. A window must be
deleted via a call to DELWIND or RSTRWIND
before the number assigned to it can be used
again. This error will not be reported for
window number 0 as it is not saved.
ERROR 9 A call to INPTINIT was not made to initialize
input memory. INPTINIT must be called once in
every program prior to calling routines INPTWIND
or MULTINPT.
ERROR 11 A bad row number was specified in a call to
PRINTW or LINEW. The row number must be
greater than 0. PRINTW allows print on the
bottom border. LINEW does not. The string
specified in a call to PRINTW will not fit in
the window due to it's length or it's left
column ( start print ) position.
ERROR 12 The row position of the info-line is less than
1 or greater than 25. The left column position
is out of range. A combination of the left
column position plus the specified width will not
allow the info-line to fit on one line.
ERROR 21 The array ( LIST$() ) in a call to SCRLWIND
has a lower dimension greater than 1 or an
upper dimension less then the number of
entries ( ENTRIES% ) in the list.
ERROR 22 A call was made to SCRLWIND with less than one
entry ( ENTRIES% ).
ERROR 23 A scroll window requires a minimum width of 5.
87
Copyright(c) 1988-92 - By: CONNECT Software - All rights reserved.
ERROR 24 At least one of the strings in the list for a
scroll window ( SCRLWIND ) will not fit in the
window, allowing for a space on either side of
the string. ( non-virtual scroll windows only )
ERROR 24 The number of entries in an "EXTENDED" scroll
window exceeds the number or interior rows in the
scroll window.
ERROR 31 The location of menubar string specified in a
call to SETPULL is invalid. The row position may
range from 1 to 21. The left column position plus
the menubar's width may not exceed 81.
ERROR 32 The menubar string specified in a call to
SETPULL has over 10 items or less than 2 items
in it.
ERROR 33 There are no items in a pulldown window. Two
consecutive "***"'s may be in the data stream.
ERROR 41 The requested width of in input field in
INPTWIND is out of range. The maximum width
is 15 for numeric fields, the screens width
minus 4 for windowed ALPHA/NUMERIC fields, or
the screens width minus 1 for un-windowed
ALPHA/NUMERIC fields. The minimum width for a
numeric field is the number of decimal places
plus one. The minimum width for an ALPHA-
NUMERIC field is 1. A date field must have a
width of 8 or 10.
ERROR 42 The field code in INPTWIND does not consist of
legal characters. ("0","1","2","3","4","5","6",
"A","L","U","D","P0","P1","P2","P3","P4","P5,
or "P6 )
ERROR 51 The screen number in MULTINPT is less than one
or over 10. ( over 4 for unenhanced version )
ERROR 52 The array ( RTRN$() ) specified in a call to
MULTINPT has a lower dimension of greater than
one or an upper dimension less than the number
of fields in the multi-field input screen.
ERROR 53 The screen number in a call to MULTINPT was
not defined via a call to SETINPT.
88
Copyright(c) 1988-92 - By: CONNECT Software - All rights reserved.
ERROR 54 The field number ( TOFLD%) specified in call to
MULTINPT is greater than the number of fields in
the multi-field input screen or less than one.
The auto-exit ( AUTOEXIT%) field is greater than the
number of fields in the multi-field input screen or
less than 0.
ERROR 55 The screen width when MULTINPT was called was
not the same as specified when the multi-field
input screen was defined by SETINPT.
ERROR 61 The screen number in a call to SETINPT is less
than one or greater than 10.
ERROR 62 The screen width in a call to SETINPT is not
80 or 40.
ERROR 63 The exit string ( EXIT$ ) in a call to SETINPT
is null or contains an illegal character.
Legal characters are: "1234567890EUD".
ERROR 64 The input data ( INPT%(), INPUT$() ) is not in
the correct format in a call to SETINPT.
ERROR 65 Over 150 fields were defined in a call to
SETINPT. ( 25 in the unenhanced version )
ERROR 66 No fields were defined in a call to SETINPT.
ERROR 67 At least one field in a call to SETINPT has an
illegal field code. SEE THE MULTI-FIELD CODE
CHART.
ERROR 68 The field width is not appropriate for the
type of field specified in a call to SETINPT.
ERROR 69 The left position plus the width of a field
defined in a call to SETINPT will not allow
the field to fit on the screen. The row or
column position is less than one. The row
position of a field is greater than 26.
ERROR 70 All fields defined in a call to SETINPT are
protected fields. No input is possible.
ERROR 71 The cumulative total of restrict characters
for all fields for a multi-field input screen
defined via SETINPT is greater than 1023.
89
Copyright(c) 1988-92 - By: CONNECT Software - All rights reserved.
ERROR 72 The number of characters in a restrict string
( INPT$() ) for an individual field defined
in a call to SETINPT is greater than 255.
ERROR 73 The array ( INPT$() ) in SETINPT, which
defines the field's restrict strings is
dimensioned less than the number of fields or
has a lower dimension greater than one.
90
Copyright(c) 1988-92 - By: CONNECT Software - All rights reserved.
APPENDIX I
Color Attribute Chart
ATTRIBUTE BACKGROUND FOREGROUND
START END
0 ------ 15 BLACK NORMAL
16 ------ 31 BLUE NORMAL
32 ------ 47 GREEN NORMAL
48 ------ 63 CYAN NORMAL
64 ------ 79 RED NORMAL
80 ------ 95 MAGENTA NORMAL
96 ------ 111 BROWN NORMAL
112 ----- 127 LIGHT GRAY NORMAL
128 ----- 143 BLACK FLASHING
144 ----- 159 BLUE FLASHING
160 ----- 175 GREEN FLASHING
176 ----- 191 CYAN FLASHING
192 ----- 207 RED FLASHING
208 ----- 223 MAGENTA FLASHING
224 ----- 239 BROWN FLASHING
240 ----- 255 LIGHT GRAY FLASHING
-----------------------------------------------------------
OFFSET FROM START FOREGROUND
0 BLACK
1 BLUE
2 GREEN
3 CYAN
4 RED
5 MAGENTA
6 BROWN
7 LIGHT GRAY
8 DARK GRAY
9 LIGHT BLUE
10 LIGHT GREEN
11 LIGHT CYAN
12 LIGHT RED
13 LIGHT MAGENTA
14 YELLOW
15 WHITE
EXAMPLE: If the attribute = 242 then the background color is
light gray and the foreground flashes. The offset
from start = 242 - 240 or 2, so the foreground color
is green.
NOTE: GETANS and SCRLWIND allow a flashing border only.
CHNGPULL, PULLDOWN, AND MULTINPT will not allow a flashing
border or text.
91
Copyright(c) 1988-92 - By: CONNECT Software - All rights reserved.
APPENDIX II
Multi-field code chart
The code for each field can be up to five digits long. The
digits are numbered 5,4,3,2 and 1, with 1 being the least
significant digit and 5 the most significant digit.
DIGIT NUMBER ------- 5 4 3 2 1
EXAMPLE CODE% ------ 2 1 0 1 6
- Digits 1 and 2 set the field type and can be:
00 ------ Numeric - no decimal places.
01 to 06 - Numeric - 1 to 6 decimal places
10 ------- Numeric - no decimal places - padded with leading
zeros.
11 to 16 - Numeric - 1 to 6 decimal places - padded with
leading zeros.
07 ------- Alpha/numeric
17 ------- Alpha/numeric -- UPPER CASE
27 ------- Alpha/numeric -- lower case
08 ------- Date
- Digit 3 sets a protected field ( No entry ) and can be:
0 -------- Field is NOT protected.
1 -------- Field is protected.
- Digit 4 sets an Auto-advance field and can be:
0 -------- Field is NOT Auto-advance.
1 -------- Field is Auto-advance.
- Digit ---- 5 sets an Auto-exit field and can be:
0 -------- Field is NOT Auto-exit.
1 -------- Field is Auto-exit. ( Always )
2 -------- Field is Auto-exit. ( On change only )
3 -------- Field is Fixed-choice. ( auto-exit - always )
EXAMPLE: IF CODE% = 21016 the field is decimal with padded
zero's, Auto-advance, and Auto-exit ( on change ).
NOTE: If digit 3 is set to 1 (protected) digits 4 and 5 are
ignored .
92
Copyright(c) 1988-92 - By: CONNECT Software - All rights reserved.
APPENDIX III
Border Designations
DIGIT NUMBER 3 2 1
EXAMPLE BORDER% 1 2 1 ( 121 )
Digit 1 = Border Digit 2 = Shadow Digit 3 = Title Box
Example (121) = title box/ left bottom shadow/ single line border
------------------------------------------------------------------
:---Border---: :------- Shadow -----------:
Border Single Double Title Right Left Left Right
Value Line Line Box Bottom Bottom Top Top
0 No border, title box, or shadow
1 X
2 X
10 X
11 X X
12 X X
20 X
21 X X
22 X X
30 X
31 X X
32 X X
40 X
41 X X
42 X X
100 X
101 X X
102 X X
110 X X
111 X X X
112 X X X
120 X X
121 X X X
122 X X X
130 X X
131 X X X
132 X X X
140 X X
141 X X X
142 X X X
-------------------------------------------------------------------
See individual routines for restrictions.
93
Copyright(c) 1988-92 - By: CONNECT Software - All rights reserved.
APPENDIX IV
KEYMOUSE CODE VALUES
KEYMOUSE% Key(s)
1 to 255 The equivalent key which produces the
corresponding ASCII/IBM code.
( 65 = A, 66 = B etc. )
15104 F1
15360 F2
15616 F3
15872 F4
16128 F5
16384 F6
16640 F7
16896 F8
17152 F9
17408 F10
18432 UP ARROW ( MOUSE UP )
20480 DOWN ARROW ( MOUSE DOWN )
19200 LEFT ARROW ( MOUSE LEFT )
19712 RIGHT ARROW ( MOUSE RIGHT )
18688 PGUP
20736 PGDN
18176 HOME
20224 END
20992 INSERT
21248 DELETE
29952 CTRL-END
30464 CTRL-HOME
NOTE: THIS LIST IS NOT ALL INCLUSIVE. IT DOES PROVIDE
VALUES FOR COMMON KEYS OR KEY COMBINATIONS.
To find the values for other keys or key combinations this
small program can be used. Press ESC to end the program.
DECLARE FUNCTION KEYMOUSE%
GETKEY:
A%= KEYMOUSE%
PRINT A%
IF A% <> 27 THEN GOTO GETKEY
END
As a key or key combination is pressed the corresponding
value will print on the screen.
94
Copyright(c) 1988-92 - By: CONNECT Software - All rights reserved.
RESTRICTIONS
------------------------------------------------------------
UNENHANCED LIBRARY
------------------
THE UNENHANCED LIBRARY IS OFFERED ON A TRIAL BASIS.
IT MAY BE USED FOR EVALUATION. EXECUTABLE PROGRAMS MADE
FROM THE UNENHANCED LIBRARY MAY NOT BE DISTRIBUTED. IF YOU
DECIDE THE ROUTINES ARE USEFUL, REGISTRATION MAY BE
ACCOMPLISHED BY VIRTUE OF SECURING THE ENHANCED VERSION.
THE UNENHANCED LIBRARY MAY NOT BE ALTERED. THE UNENHANCED
LIBRARY MAY BE DISTRIBUTED, PROVIDED IT IS DISTRIBUTED WITH
ALL OF THE FILES INCLUDED IN QWEZ51.ZIP OR PWEZ51.ZIP.
THE FILES, QWEZ51.ZIP OR PWEZ51.ZIP , MAY BE UP-
LOADED IN THEIR ENTIRETY TO ANY PUBLIC OR PRIVATE BULLETIN
BOARD. INDIVIDUAL FILES NOT BE UP-LOADED.
------------------------------------------------------------
ENHANCED VERSION
-----------------
ALL OF THE SOURCE CODE, OBJECT CODE, AND LIBRARIES
INCLUDED IN WINDOWS R-E-Z IS COPYRIGHTED. COPYING AND
DISTRIBUTING ANY OF THE MATERIAL IS PROHIBITED. PROGRAMS
MADE USING ANY OF THE PROCEDURES FROM WINDOWS R-E-Z IN THE
EXECUTABLE (.EXE ) FORM MAY BE DISTRIBUTED FREELY BY
ORIGINAL PURCHASERS.
------------------------------------------------------------
COPYRIGHT WARNING
-----------------
EXTRANEOUS CODE HAS BEEN INSERTED IN THE LIBRARY
FILES. ANY PROGRAM MADE USING THE LIBRARY FILES IS
DISTINGUISHABLE AS ORIGINATING FROM WINDOWS R-E-Z. CONNECT
SOFTWARE WILL TAKE APPROPRIATE ACTION IF COPYRIGHT
INFRINGEMENT IS DISCOVERED.
------------------------------------------------------------
DISCLAIMER
----------
ANY LOSS INCURRED FROM THE USE OF THE PROCEDURES CON-
TAINED IN WINDOWS R-E-Z, OR ANY LOSS BELIEVED TO BE CAUSED
FROM THE PROCEDURES CONTAINED IN WINDOWS R-E-Z IS NOT THE
RESPONSIBILITY OF CONNECT SOFTWARE. USERS OF WINDOWS R-E-Z
ASSUME FULL RESPONSIBILITY FOR THE USE OF ANY PROCEDURES
CONTAINED WITHIN.
------------------------------------------------------------
95
Copyright(c) 1988-92 - By: CONNECT Software - All rights reserved.